#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  cin >> s;
  int n = (int)s.length();
  int i;
  int chk[2] = {0,0};
  for(i=0;i<n;i++){
    if(s[i] == '0')chk[0]++;
    else chk[1]++;
  }
  cout << (max(chk[0],chk[1])-min(chk[0],chk[1])) << endl;
}