print(len([int(i) for i in list(input().strip()) if i != '0']) - 1)