n = input() c = [3, 2, 2, 2, 3, 2, 3, 2, 4, 3] ans = 1 for l in n: ans += c[int(l)] print(ans)