#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const long long int base = 313;
const long long int inf = 1e8;
const long long int mod = 1e9 + 7;
const int lg = 20;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string second;
  cin >> second;
  int ans = 0;
  while (second.size()) {
    int k = 0;
    while (second.size() && second.back() == '0') second.pop_back();
    while (second.size() && second.back() == '1') {
      k++;
      second.pop_back();
    }
    if (second.size()) second.pop_back();
    if (k == 1)
      ans++;
    else {
      second += '1';
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
