#include <bits/stdc++.h>
using namespace std;
int main() {
  int c = 0, n, t, f, p;
  string ar;
  cin >> ar;
  n = ar.length();
  for (int i = n - 1; i > 0; i--) {
    t = i;
    f = 0;
    if (ar[i] == '0') {
      c++;
    } else if (ar[i] == '1') {
      while (t--) {
        if (ar[t] == '0') {
          ar[t] = '1';
          c = c + (i - t) + 1;
          i = t + 1;
          f = 1;
          break;
        }
      }
      if (f == 0) {
        c += i + 2;
        break;
      }
    }
  }
  cout << c << "\n";
}
