#include <bits/stdc++.h>
using namespace std;
const int N = 1000002;
int n, dp[N][2];
char a[N];
int solve(int i, int j) {
  if (i == n) return j ? 1000000000 : 0;
  if (dp[i][j] != -1) return dp[i][j];
  if (a[i] == '0') {
    if (j)
      dp[i][j] = 1 + solve(i + 1, 1);
    else
      dp[i][j] = min(1 + solve(i + 1, 1), solve(i + 1, 0));
  } else {
    if (j)
      dp[i][j] = min(1 + solve(i + 1, 0), solve(i + 1, 1));
    else
      dp[i][j] = 1 + solve(i + 1, 0);
  }
  return dp[i][j];
}
int main() {
  scanf("%s", a);
  n = strlen(a);
  memset(dp, -1, sizeof dp);
  cout << min(solve(0, 0), 1 + solve(0, 1));
}
