C = input() C_list = [] for i in C: C_list.append(i) if '0' not in C_list: print(len(C_list)-1) else: n = len(C_list)-1 - C_list.count('0') print(n)