#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] == '0')
      zero += 1;
    else
      one += 1;
  }
  int ans = abs(one - zero);
  cout << ans << endl;
}
