import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = map(int, read().rstrip().decode()) G = [1,0,0,0,1,0,1,0,2,1] answer = 1 + sum(G[n]+2 for n in N) print(answer)