#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  s = "0" + s;
  vector<int> v(int(s.size()), 0);
  for (int i = int(s.size()) - 1; i >= 0; i--) {
    if (s[i] == '1') {
      v[i] = -1;
      while (s[i] != '0') i--;
      v[i] = 1;
    }
  }
  for (int i = 1; i < int(v.size()); i++) {
    if (v[i] == -1 and v[i - 1] == 1) {
      v[i - 1] = 0;
      v[i] = 1;
    } else if (v[i] == 1 and v[i - 1] == -1) {
      v[i - 1] = 0;
      v[i] = -1;
    }
  }
  int count = 0;
  for (int i = 0; i < int(v.size()); i++)
    if (v[i] != 0) count++;
  cout << count << endl;
}
