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