#include <bits/stdc++.h>
char s[1 << 20];
int i, n, c, b;
int main() {
  gets(s);
  while (s[++i])
    if (s[i] - 48) {
      n += c;
      c = 0;
      b = 1;
    } else
      ++c;
  printf("%d", 2 * b - 1 + i + n);
}
