#include <bits/stdc++.h>
int abs(int a) {
  if (a < 0) return -1 * a;
  return a;
}
int big(int a, int b) {
  if (a > b) return a;
  return b;
}
int small(int a, int b) {
  if (a < b) return a;
  return b;
}
int compare(const void *a, const void *b) {
  int *p1 = (int *)a;
  int *p2 = (int *)b;
  return *p1 - *p2;
}
char s[1000005];
int main() {
  int m, l, ans, sum, min, max, n, i, j, k, x, y, t;
  scanf("%s", s);
  n = strlen(s);
  i = n - 1;
  int count = 0;
  while (i >= 0) {
    if (s[i] == '0') {
      i--;
      continue;
    }
    count++;
    if (i == 0) {
      i--;
      continue;
    }
    if (s[i - 1] == '0') {
      i--;
      continue;
    }
    while (s[i] != '0' && i) i--;
    if (i == 0) {
      count++;
      i--;
      continue;
    }
    s[i] = '1';
  }
  printf("%d", count);
  return 0;
}
