#include <bits/stdc++.h>
char s[1001000];
int main() {
  int a = 0, b = 1;
  char c;
  while (1) {
    c = getchar();
    if (c == '\n' || c == EOF) break;
    if (c == '0')
      b = (a < b ? a : b) + 1;
    else
      a = (a < b ? a : b) + 1;
  }
  printf("%d\n", a);
  return 0;
}
