#include <bits/stdc++.h>
char src[1000005];
int main() {
  scanf("%s", src);
  int len = strlen(src), ans = 0;
  int cnt = 0;
  for (int i = len - 1; i >= 0; i--) {
    if (src[i] == '1') {
      if (cnt == 0) {
        ans++;
      }
      cnt++;
    } else {
      if (cnt > 1) {
        ans++;
        cnt = 1;
      } else {
        cnt = 0;
      }
    }
  }
  if (cnt > 1) ans++;
  printf("%d\n", ans);
  return 0;
}
