#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  string s;
  cin >> s;
  int zero = 0, one = 0;
  int n = s.size();
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '0') {
      zero++;
    } else {
      one++;
    }
  }
  cout << abs(zero - one) << endl;
}
