#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int cnt = 0;
  while (true) {
    int tmp = n;
    for (int i = 0; i < n - 1; i++) {
      if (s[i] == '0' && s[i + 1] == '1') {
        s.erase(s.begin() + i + 1);
        s.erase(s.begin() + i);
        n -= 2;
        cnt += 2;
      }
    }
    if (tmp == n) break;
  }
  cout << cnt << endl;
  return 0;
}
