#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int counta = 0;
  int countb = 0;
  for (int i = 0; i < S.length(); i++) {
    if (S.at(i) == '0') {
      counta++;
    } else
      countb++;
  }
  cout << abs(counta - countb) << endl;
  return 0;
}
