#include <bits/stdc++.h>
using namespace std;
int main() {
  long long unsigned int tmp, num;
  string S;
  cin >> S;
  num = S.length();
  int r, b;
  for (int i = 0; i < num; i++) {
    if (S[i] == '0') r++;
    if (S[i] == '1') b++;
  }
  if (r == b) {
    cout << num << endl;
    return 0;
  }
  if (r > b) {
    cout << num - (r - b) << endl;
    return 0;
  }
  if (r < b) {
    cout << num - (b - r) << endl;
    return 0;
  }
  return 0;
}
