#include <bits/stdc++.h>
using namespace std;
char gsz[1000010];
int val[1000110];
int main() {
  cin >> gsz + 1;
  int i, pos = 0, len = strlen(gsz + 1);
  int cnt = 0, ans = 0;
  pos = len;
  while (pos) {
    cnt = 0;
    while (gsz[pos] == '0' && pos) pos--;
    while (gsz[pos] == '1' && pos) pos--, cnt++;
    ans++;
    if (pos == 0 && cnt > 1) {
      ans++;
      break;
    }
    if (1 != cnt) {
      gsz[pos] = '1';
    }
  }
  ans = max(1, ans);
  cout << ans;
}
