#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
char str[N];
int dp[N][2];
int main() {
  scanf("%s", str);
  int len = (int)strlen(str);
  if (str[len - 1] == '0') {
    dp[len - 1][0] = 0;
    dp[len - 1][1] = 1;
  } else {
    dp[len - 1][0] = 1;
    dp[len - 1][1] = 1;
  }
  for (int i = len - 2; i >= 0; i--) {
    if (str[i] == '0') {
      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] + 1);
    } else {
      dp[i][0] = min(dp[i + 1][0] + 1, dp[i + 1][1] + 2);
      dp[i][1] = min(dp[i + 1][0] + 1, dp[i + 1][1]);
    }
  }
  printf("%d\n", min(dp[0][0], dp[0][1] + 1));
  return 0;
}
