#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.size();
  vector<int> t(N);
  for (int i = 0; i < N; i++) {
    if (S[i] == '0')
      t[i] = 0;
    else
      t[i] = 1;
  }
  bool detect;
  do {
    detect = false;
    for (int i = 0; i < N - 1; i++) {
      if (t[i] != t[i + 1]) {
        t.erase(t.begin() + i);
        t.erase(t.begin() + i);
        detect = true;
        i++;
      }
    }
  } while (detect);
  cout << N - t.size() << endl;
  return 0;
}
