#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int zero_count = 0;
  int one_count = 0;
  int result = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s.at(i) == '1') {
      one_count++;
    } else if (s.at(i) == '0') {
      zero_count++;
    }
  }
  result = one_count - zero_count;
  if (result < 0) result = result * (-1);
  cout << result << endl;
  return 0;
}
