#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  string s;
  cin >> s;
  int count = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') {
      count--;
    } else {
      count++;
    }
  }
  cout << s.size() - count << endl;
  return 0;
}
