#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
string s;
bool countt[maxn];
int n, ans = 0;
int main() {
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; i++) {
    if (s[i] == 0) {
      if (s[i + 1] == 1) {
        countt[i] = false;
        countt[i + 1] = false;
      } else if (s[i - 1] == 1) {
        countt[i] = false;
        countt[i - 1] = false;
      } else {
        for (int j = i; j < n; j++) {
          if (s[j] == 1) {
            countt[i] = false;
            countt[j] = false;
          }
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (countt[i] == false) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
