#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void checkmin(T &a, T b) {
  if (a > b) a = b;
}
char s[1000001];
void solve() {
  memset(s, 0, sizeof(s));
  scanf("%s", s);
  int n = strlen(s);
  int lst = n - 1;
  int res = 0;
  for (int i = (n - 1); i >= (0); i--)
    if (s[i] == '1') {
      lst = i;
      break;
    } else
      res++;
  while (1) {
    if (lst == 0) {
      if (s[lst] == '0') res += 1;
      break;
    }
    int cnt = 0;
    for (int i = (lst); i >= (0); i--)
      if (s[i] != '1')
        break;
      else
        cnt++;
    res += cnt + 1;
    lst -= cnt;
    s[lst] = '1';
    if (lst <= 0) break;
  }
  printf("%d\n", res);
}
int main() {
  solve();
  return 0;
}
