#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int one = 0, two = 0, q = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '1') {
      one++;
    } else if (s[i] == '0') {
      two++;
    } else {
      q++;
    }
  }
  cout << abs(one - two) << endl;
  return 0;
}
