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