#include <bits/stdc++.h>
using namespace std;
string s;
int n;
int f(int i, int pre, vector<vector<int>>& dp) {
  if (i == n) return 0;
  if (dp[i][pre] != -1) return dp[i][pre];
  if (s[i] == '0') {
    if (pre == 0) dp[i][pre] = f(i + 1, 0, dp);
    if (pre == 1) dp[i][pre] = 1 + min(f(i + 1, 0, dp), f(i + 1, 1, dp));
  } else {
    if (pre == 1) dp[i][pre] = f(i + 1, 1, dp);
    if (pre == 0) dp[i][pre] = 1 + min(f(i + 1, 1, dp), f(i + 1, 0, dp));
  }
  return dp[i][pre];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  reverse((s).begin(), (s).end());
  s.push_back('0');
  n = s.length();
  vector<vector<int>> dp(n, vector<int>(2, -1));
  cout << f(0, 0, dp) << '\n';
  return 0;
}
