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