#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int count1 = 0;
  int dp[100000] = {0};
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 1) count1++;
  }
  int count0 = s.size() - count1;
  cout << abs(count0 - count1) << endl;
}
