import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); char[] values = sc.next().toCharArray(); int plus = 2; int normal = 0; for (int i = values.length - 1; i >= 0; i--) { int nextPlus; int nextNormal; if (values[i] == '1') { nextPlus = Math.min(plus, normal + 1); nextNormal = normal + 1; } else { nextPlus = plus + 1; nextNormal = Math.min(plus + 1, normal); } plus = nextPlus; normal = nextNormal; } System.out.println(Math.min(plus + 1, normal)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }