#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  char N[6];
  int zero_num = 0;
  int one_num = 0;
  strcpy(N, str.c_str());
  for (int i = 0; i < str.length(); i++) {
    if ((N[i] - '0') == 0) {
      zero_num += 1;
    } else {
      one_num += 1;
    }
  }
  int ans;
  if (zero_num < one_num) {
    ans = str.length() - (one_num - zero_num);
  } else {
    ans = str.length() - (zero_num - one_num);
  }
  cout << ans << endl;
  return 0;
}
