#include <bits/stdc++.h>
using namespace std;
int main() {
  int count = 0;
  string str;
  cin >> str;
  while (str != "1") {
    if (str[str.length() - 1] == '1') {
      for (int i = str.length() - 1; i >= 0; i--) {
        if (str[i] == '1') {
          str[i] = '0';
          if (i == 0) {
            str = "1" + str;
            break;
          }
        } else {
          str[i] = '1';
          break;
        }
      }
    } else {
      str.erase(str.length() - 1, 1);
    }
    count++;
  }
  cout << count << endl;
  return 0;
}
