import java.util.*;
import java.io.*;

public class Comp {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(new  File("computer.in"));
		PrintWriter out = new PrintWriter("computer.out");
		
		String s = in.next();
		int sum = 0;
		int count = 0;
		for(int i = 0;i<=s.length()-1;i++){
			
			int n = s.charAt(i)-'0';
			
			if (n>0){
				count++;
			}
			if (n==0 && count>0){sum++;}
			if (n==1 && i==s.length()-1){sum++;}
		}
		out.print(sum);
		out.close();
		in.close();
	}

}