#include <bits/stdc++.h>
using namespace std;
void solve() {
  string S;
  cin >> S;
  int l = S.size(), z = 0;
  for (char c : S) {
    z += c == '0';
  }
  z = min(z, l - z);
  cout << l - z * 2 << endl;
}
int main(void) {
  solve();
  return 0;
}
