#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.size() == 1) return puts("0"), 0;
  int n = s.size(), res = 0;
  char t = '0';
  s = s;
  for (int i = n - 1; i > 0; i--) {
    if (t == '0') {
      if (s[i] == '1') {
        res += 2;
        t = '1';
      } else {
        res++;
        t = '0';
      }
    } else {
      if (s[i] == '1') {
        res++;
        t = '1';
      } else {
        res += 2;
        t = '1';
      }
    }
  }
  res += (t == '1');
  printf("%d", res);
  return 0;
}
