#include <bits/stdc++.h>
using namespace std;
int warizan(int _num) {
  int count = 0;
  while (true) {
    if ((_num % 10) == 1) {
      ++count;
    }
    _num /= 10;
    if (_num == 0) {
      break;
    }
  }
  return count;
}
int main() {
  string str;
  cin >> str;
  int n = int(str.size());
  stringstream ss;
  int num;
  ss << str;
  ss >> num;
  int count;
  count = warizan(num);
  int sub = n - count;
  if (count > sub) {
    cout << (n - 2 * sub) << endl;
  } else {
    cout << (n - 2 * count) << endl;
  }
  return 0;
}
