#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int one = 0;
  int zero = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '1') {
      one++;
    } else {
      zero++;
    }
  }
  cout << S.size() - max(one, zero) - min(one, zero) << endl;
  return 0;
}
