#include <bits/stdc++.h>
using namespace std;
int n, k, a;
int main() {
  string s;
  cin >> s;
  long long int ans = 0;
  if ((int)s.size() == 1)
    cout << (ans) << endl;
  else {
    reverse(s.begin(), s.end());
    for (int i = 0; i < (int)s.size() - 1; i++) {
      if (s[i] == '0')
        ans++;
      else {
        int j = 0;
        for (j = i; s[j] == '1'; j++) s[j] = '0';
        if (j == (int)s.size()) s += " ";
        s[j] = '1';
        ans += 2;
      }
    }
    cout << (ans) << endl;
  }
  return 0;
}
