#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a = 0, b = 0;
  for (auto itr : s) {
    if (itr == '1')
      a++;
    else
      b++;
  }
  cout << abs(a - b) << endl;
}
