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