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 (sb.charAt(i) == '1') { if (!flg) { ans++; flg = true; } } else { if (flg) { ans++; if (sb.charAt(i + 1) == '0') { flg = false; } } } } if (flg) { ans++; } System.out.println(ans); } }