import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); String n = sc.next(); sc.close(); StringBuilder sb = new StringBuilder(n); sb.reverse().append("0"); int ans = 0; boolean flg = false; for (int i = 0; i < n.length(); i++) { if (flg) { if (sb.charAt(i) == '0') { ans++; if (sb.charAt(i + 1) == '0') { flg = false; } } } else { if (sb.charAt(i) == '1') { ans++; if (sb.charAt(i + 1) == '1') { flg = true; } } } } if (flg) { ans++; } System.out.println(ans); } }