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