#include <bits/stdc++.h>
using namespace std;
int rep(int ans, string s) {
  bool f = false;
  for (int i = 0; i < s.size(); ++i) {
    int n = (int)s.find("01");
    if (n != -1) {
      s.erase(n, 1);
      ans += 2;
    }
  }
  return ans;
}
int main() {
  string s;
  cin >> s;
  cout << rep(0, s) << endl;
  return 0;
}
