#include <bits/stdc++.h>
using namespace std;
int n, c, x, y;
string s;
int main() {
  cin >> s, c = x = 1;
  while ((y = x) < (n = s.length())) {
    while (s[y] == s[x]) ++y;
    c += (s[x] == '1' || y < n), x = y + 1;
  }
  cout << c;
}
