#include <bits/stdc++.h>
using namespace std;
bool myfunction(int i, int j) { return (i < j); }
int main() {
  std::ios::sync_with_stdio(false);
  std::string number;
  cin >> number;
  int n = number.size(), count = 0;
  bool carrier = false;
  for (unsigned int i = 0; i < n - 1; i++)
    if (carrier) {
      if (number[n - i - 1] == '0')
        count += 2;
      else
        count++;
    } else {
      if (number[n - i - 1] == '0')
        count++;
      else {
        count += 2;
        carrier = true;
      }
    }
  if (carrier) count++;
  cout << count;
  return 0;
}
