#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans;
  int be, af;
  string s;
  cin >> s;
  be = s.size();
  bool hantei;
  do {
    hantei = false;
    int RB = s.find("01");
    if (RB < 100001) {
      hantei = true;
      s.erase(RB, RB + 1);
    }
  } while (hantei);
  af = s.size();
  ans = be - af;
  cout << ans << endl;
  return (0);
}
