#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  string::size_type p;
  cin >> s;
  p = s.find_last_of('1');
  if (p == 0) {
    n = s.length() - 1;
  } else {
    n = s.length() + 1;
    n += count(s.begin(), s.begin() + p, '0');
  }
  cout << n << endl;
  return 0;
}
