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