#include <bits/stdc++.h>
int n, c, x, y;
char s[1111111];
int main() {
  gets(s), n = strlen(s), c = x = 1;
  while ((y = x) < n) {
    while (s[y] == s[x]) ++y;
    c += (s[x] == '1' || y < n), x = y + 1;
  }
  printf("%d", c);
}
