#include <bits/stdc++.h>
using namespace std;
int c[111];
int main() {
  string s;
  cin >> s;
  int res = 0;
  while (s != "1") {
    int len = s.length() - 1;
    while (len >= 1 && s[len] == '0') {
      s.erase(len, 1);
      res++, len--;
    }
    if (s[len] == '1' && len != 0) {
      res += 2;
      s.erase(len, 1);
      len--;
      while (len >= 1 && s[len] == '1') {
        s.erase(len, 1);
        res++;
        len--;
      }
      if (len >= 1 && s[len] == '0') s[len] = '1';
      if (len == 0 && s[len] == '1') res++;
    }
  }
  printf("%d\n", res);
  return 0;
}
