#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main() {
  string S;
  cin >> S;
  if (S.size() <= 1) {
    cout << 0 << endl;
    return 0;
  }
  int c = 0;
  int i = 0;
  while (1) {
    int a = S.at(i) - '0';
    int b = S.at(i + 1) - '0';
    if (a ^ b) {
      S.erase(i, 1);
      S.erase(i, 1);
      c += 2;
      if (i != 0) i--;
      if (S.empty()) break;
      continue;
    }
    if (++i >= (int)S.size() - 1) break;
  }
  cout << c << endl;
}
