#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  reverse(str.begin(), str.end());
  int size = str.size();
  int idx = 0;
  long long sum = 0;
  for (int i = 0; i < size; i += 1) {
    if (str[i] == '1') {
      idx = i;
      break;
    }
    sum++;
  }
  while (idx < size - 1) {
    sum += 2, idx++;
    while (str[idx] == '1') sum++, idx++;
  }
  cout << sum << endl;
  return 0;
}
