#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
int n;
char str[1000500];
int main() {
  scanf("%s", str);
  n = strlen(str);
  reverse(str, str + n);
  str[n] = '0';
  str[n + 1] = '0';
  int ans = 0;
  int cur = 0, i = 0;
  while (i <= n + 1) {
    if (str[i] == '1')
      ++cur;
    else if (cur > 0) {
      ++ans;
      if (cur > 1) {
        str[i] = '1';
        --i;
      }
      cur = 0;
    }
    ++i;
  }
  printf("%d\n", ans);
  return 0;
}
