#include <bits/stdc++.h>
using namespace std;
char Number[1000000 + 5];
bool Flag;
int Result;
int main(int argc, char** argv) {
  gets(Number);
  Flag = Result = 0;
  int i;
  for (i = strlen(Number) - 1; i >= 1; i--) {
    if (Flag == false && Number[i] == '0')
      Result++;
    else if (Flag == false && Number[i] == '1')
      Result += 2, Flag = true;
    else if (Flag == true && Number[i] == '1')
      Result++;
    else if (Flag == true && Number[i] == '0')
      Result += 2, Flag = true;
  }
  if (Flag == true && Number[i] == '1') Result++;
  printf("%d\n", Result);
  return 0;
}
