import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] arr = br.readLine().toCharArray(); boolean isUp = false; int count = 0; for (int i = arr.length - 1; i >= 0; i--) { boolean now = arr[i] == '1'; if (isUp ^ now) { count++; if (i != 0 && arr[i - 1] == '1') { isUp = true; } else { isUp = false; } } } if (isUp) { count++; } System.out.println(count); } }