#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> colors(n);
  int sum = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    colors[i] = (int)(s[i] - '0');
    cout << colors[i] << endl;
  }
  for (int i = 0; i < colors.size(); i++) {
    sum += colors[i];
    if (sum == 1) {
      colors.erase(colors.begin() + i);
      colors.erase(colors.begin() + i - 1);
      i = 0;
      sum = 0;
      ans += 2;
    }
  }
  cout << ans << endl;
}
