#include <bits/stdc++.h>
using namespace std;
int n, a[1000000 + 5], res;
char s[1000000 + 5];
int main() {
  scanf("%s", &s);
  n = strlen(s);
  for (int i = 1; i <= n; ++i) a[i] = int(s[n - i] - '0');
  ++n;
  for (int i = 1; i <= n; ++i)
    if (a[i] == 1) {
      if (a[i + 1] == 1) {
        while (a[i] == 1) ++i;
        a[i--] = 1;
      }
      ++res;
    }
  printf("%d\n", res);
  return 0;
}
