#include <bits/stdc++.h>
using namespace std;
int len, dp[1000009];
string str;
int solve(int ind) {
  if (ind >= len - 1) {
    return 1;
  }
  if (str[ind] == '0') return solve(ind + 1);
  int cnt = 0;
  for (int i = ind; i < len; i++) {
    if (str[i] == '0') break;
    cnt++;
  }
  if (cnt > 1) {
    str[ind + cnt] = '1';
    return solve(ind + cnt) + 1;
  } else
    return solve(ind + 1) + 1;
}
int main() {
  int i, j;
  int cases = 1;
  int K, n;
  int m;
  cin >> str;
  reverse(str.begin(), str.end());
  len = str.length();
  int res = solve(0);
  cout << res << endl;
  return 0;
}
