#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string x;
  bool pepe = false;
  long long c = 0;
  cin >> x;
  long long len = x.length(), cnt = len - 1;
  while (pepe == 0 && len > 1) {
    if (x[len - 1] == '1') {
      cnt = len - 1;
      while (true) {
        if (cnt == 0 && x[cnt] == '1') {
          c += len;
          pepe = true;
          break;
        }
        if (x[cnt] == '1') {
          c++;
          len--;
          cnt--;
        } else if (x[cnt] == '0') {
          x[cnt] = '1';
          break;
        }
      }
      c++;
    }
    if (pepe) {
      break;
    } else {
      while (x[len - 1] == '0') {
        len--;
        c++;
      }
    }
  }
  cout << c;
  return 0;
}
