#include <bits/stdc++.h>
using namespace std;
int main() {
  string data;
  int res, count, len, min, temp;
  cin >> data;
  res = 0;
  count = 0;
  min = 0;
  len = data.length();
  for (int i = len - 1; i >= 0; i--) {
    if (len == 1) {
      res = 0;
      break;
    }
    if (data[i] == '0' && count == 0) {
      res++;
    } else if (data[i] == '1' && count == 0) {
      count = 1;
      min = 1;
    } else if (data[i] == '1' && count == 1) {
      res++;
      min++;
    } else if (data[i] == '0' && count == 1) {
      res += 2;
    }
  }
  if (min > 1) res += 2;
  printf("%d\n", res);
  return 0;
}
