#include <bits/stdc++.h>
using namespace std;
char s[1000001];
int main() {
  int n, i, ret = 0;
  bool carrier = false;
  scanf("%s", s);
  n = strlen(s);
  if (n == 1) {
    printf("0");
    return 0;
  }
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == '0') {
      if (carrier) {
        ret += 2;
      } else {
        ret++;
      }
    } else {
      if (carrier) {
        ret++;
      } else {
        if (!i) break;
        ret += 2;
        carrier = true;
      }
    }
  }
  printf("%d", ret);
  return 0;
}
