n = input().strip() holes = {'0':1, '1':0, '2':0, '3':0, '4':1, '5':0, '6':1, '7':0, '8':2, '9':1} total = 0 for c in n: total += holes[c] + 2 total += 1 print(total)