#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  bool one = false;
  int result = 0;
  cin >> s;
  for (int i = s.size() - 1; i > 0; i--) {
    if (!one) {
      if (s[i] == '0')
        result++;
      else {
        result += 2;
        one = true;
      }
    } else {
      if (s[i] == '1')
        result++;
      else
        result += 2;
    }
  }
  if (one) result += 1;
  cout << result << endl;
}
