#include <bits/stdc++.h>
using namespace std;
int OO = 1000000;
long long mod = 1000000007;
int main() {
  ios::sync_with_stdio(0);
  string s;
  cin >> s;
  int cnt = 0;
  while (s.size() > 1) {
    int k = s.size();
    if (s[k - 1] == '0')
      s.pop_back();
    else {
      s[k - 1] = '0';
      int i = 2;
      while (s[k - i] != '0') {
        if (k - i < 0) {
          s.insert(0, "1");
          break;
        }
        s[k - i] = '0';
        i++;
      }
      if (k - i >= 0) s[k - i] = 1;
    }
    cnt++;
  }
  cout << cnt;
}
