#include <bits/stdc++.h>
using namespace std;
int f() {
  int n;
  string s;
  cin >> s;
  n = s.size();
  int i, c1 = 0, c2 = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '0') {
      c1++;
    } else if (s[i] == '1') {
      c2++;
    }
  }
  int ans = abs(c1 - c2);
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cout << f() << "\n";
  return 0;
}
