#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> s;
  s = "00" + s;
  n = s.length();
  int ans = 0;
  for (int i = n - 1; i >= 1; i--) {
    if (s[i] == '1') {
      if (s[i - 1] == '1') {
        while (s[i] == '1') {
          s[i] = 0;
          i--;
        }
        s[i] = '1';
        i++;
      } else {
        s[i] = '0';
      }
      ans++;
    }
  }
  cout << ans;
}
