#include <bits/stdc++.h>
using namespace std;
char s[1000009];
int main() {
  s[0] = '0';
  while (cin >> s + 1) {
    int n = strlen(s) - 1, ans = 0;
    int p = n;
    while (p > 0) {
      if (s[p] == '0')
        p--;
      else {
        int one = 0;
        while (p >= 0) {
          if (s[p] == '1')
            p--, one++;
          else {
            if (one == 1) {
              ans++;
              break;
            } else {
              if (s[p + 1] == '0') {
                ans++;
                break;
              } else {
                ans++;
                p--;
                one++;
              }
            }
          }
          if (p < 0) {
            ans++;
            break;
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
