import java.util.*; public class Main { static char[] arr; static int[][] dp; public static void main (String[] args) { Scanner sc = new Scanner(System.in); arr = sc.next().toCharArray(); int length = arr.length; dp = new int[length + 1][2]; for (int[] arr : dp) { Arrays.fill(arr, -1); } System.out.println(dfw(length, 0)); } static int dfw(int idx, int added) { if (idx == 0) { return added; } if (dp[idx][added] == -1) { if (added == 0) { if (arr[idx - 1] == '0') { dp[idx][added] = dfw(idx - 1, 0); } else { dp[idx][added] = Math.min(dfw(idx - 1, 0), dfw(idx - 1, 1)) + 1; } } else { if (arr[idx - 1] == '0') { dp[idx][added] = Math.min(dfw(idx - 1, 0), dfw(idx - 1, 1)) + 1; } else { dp[idx][added] = dfw(idx - 1, 1); } } } return dp[idx][added]; } }