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