#include <bits/stdc++.h>
using namespace std;
int main() {
  string k;
  cin >> k;
  long long cnt = 0, bnt = 0;
  for (int i = 0; i < k.size(); i++) {
    if (k[i] == '1') {
      cnt++;
    }
    if (k[i] == '0') bnt++;
  }
  cout << abs(cnt - bnt) << endl;
}
