#include <bits/stdc++.h>
int main() {
  char a[1000001];
  scanf("%s", a);
  int n = strlen(a);
  for (int i = 0; i < n; i++) {
    a[i] -= '0';
  }
  int i, ans = 0;
  for (i = n - 1; i > 0; i--) {
    bool c = false;
    for (; i >= 0 && a[i] > 0; i--) {
      ans++;
      c = true;
    }
    if (i >= 0) {
      a[i] = 1;
      if (c == true) i++;
    }
    ans++;
  }
  printf("%d\n", ans);
}
