#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N, count, nocount;
  N = S.size();
  count = 0, nocount = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '0') {
      count++;
    } else {
      nocount++;
    }
  }
  cout << max(count, nocount) - min(count, nocount) << endl;
}
