#include <bits/stdc++.h>
using namespace std;
string s;
int res, i;
int main() {
  cin >> s;
  for (i = s.length() - 1; i > 0; i--) {
    if (s[i] == '1' && s[i - 1] == '0') {
      s[i - 1] = '1';
      res++;
    }
    res++;
  }
  if (s[1] == '1') res = res + 2;
  cout << res << endl;
  return 0;
}
