#include <bits/stdc++.h>
using namespace std;
int main() {
  char c = 0;
  int n = 0, m = 1, l = 0;
  while (1) {
    c = cin.get();
    if (c == -1) break;
    l = ((n < m) ? (n) : (m)) + 1;
    if (c == '1')
      n = l;
    else
      m = l;
  }
  cout << n;
  return 0;
}
