#include <bits/stdc++.h>
using namespace std;
char s[1100000];
int main() {
  int i, j, n, m, k, l, o, p;
  scanf("%s", s);
  m = 0;
  l = strlen(s);
  k = 0;
  for (i = l - 1; i > 0; i--) {
    s[i] += k;
    if (s[i] == 48)
      m++, k = 0;
    else if (s[i] == 49)
      m += 2, k = 1;
    else
      m += 1;
  }
  if (k == 1) m += 1;
  printf("%d\n", m);
  return 0;
}
