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