#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  char num[1000002], *pn;
  int i, count = 0;
  num[0] = '0';
  pn = &(num[1]);
  cin >> pn;
  i = strlen(pn) - 1;
  while (i != -1) {
    if ((i == 0 && pn[0] == '1')) {
      cout << count << endl;
      return 0;
    }
    if (pn[i] == '0') {
      i--;
    } else {
      int ci = i - 1;
      bool need_cor = true;
      pn[i] = '0';
      do {
        if (pn[ci] == '1') {
          need_cor = true;
          pn[ci] = '0';
          ci--;
        } else {
          pn[ci] = '1';
          need_cor = false;
        }
      } while (need_cor);
    }
    count++;
  }
  cout << count << endl;
}
