#include <bits/stdc++.h>
using namespace std;
char s[1000005];
int dp[1000005][2];
int main() {
  int i, l;
  scanf("%s", s);
  l = strlen(s);
  for (i = 0; i <= l; i++) {
    dp[i][0] = 999999999;
    dp[i][1] = 999999999;
  }
  dp[0][0] = 0;
  for (i = 1; i <= l; i++) {
    if (s[i - 1] == '1') {
      dp[i][0] = min(dp[i - 1][0], dp[i - 1][1]) + 1;
      dp[i][1] = min(dp[i - 1][0] + 2, dp[i - 1][1]);
    } else {
      dp[i][0] = min(dp[i - 1][0], dp[i - 1][1]);
      dp[i][1] = min(dp[i - 1][0] + 2, dp[i - 1][1]) + 1;
    }
  }
  printf("%d\n", min(dp[l][0], dp[l][1]));
}
