N = ['0'] + list(input()) # print (N) tmp1= len(N) - 1 ans = 0 while tmp1 >= 1: if N[tmp1] == '0': tmp1 -= 1 elif N[tmp1] == '1' and N[tmp1 - 1] == '1': while N[tmp1 - 1] == '1': N[tmp1] = '0' N[tmp1 - 1] = '0' tmp1 -= 1 N[tmp1 - 1] = '1' tmp1 -= 1 ans += 1 elif N[tmp1] == '1' and N[tmp1 - 1] == '0': ans += 1 tmp1 -= 1 # print (N) if N[0] == '1': ans += 1 print (ans) # print (N)