#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int x = (int)s.size();
  long long int ans = 0;
  for (int i = x - 1; i > 0; i--) {
    if (s[i] == '1') {
      ans++;
      long long int j = i;
      while (s[j] == '1' && j > 0) {
        s[j] = '0';
        j--;
      }
      s[j] = '1';
      if (j == 0) ans++;
    }
    ans++;
  }
  cout << ans;
}
