#include <bits/stdc++.h>
int main() {
  char s[2000000] = "";
  int i(0), r(0);
  std::scanf("%s", s);
  std::reverse(s, s + std::strlen(s));
  while (!(s[i] == '1' && !s[i + 1])) {
    if (s[i] == '1') {
      int j(i);
      while (s[j] == '1') s[j++] = '0';
      s[j] = '1';
    } else {
      ++i;
    }
    ++r;
  }
  std::printf("%d\n", r);
  return 0;
}
