dl = {}
dl['2'] = [0x41,0x42,0x43]
dl['3'] = [0x44,0x45,0x46]
dl['4'] = [0x47,0x48,0x49]
dl['5'] = [0x4a,0x4b,0x4c]
dl['6'] = [0x4d,0x4e,0x4f]
dl['7'] = [0x50,0x51,0x52,0x53]
dl['8'] = [0x54,0x55,0x56]
dl['9'] = [0x57,0x58,0x59,0x5a]

if __name__ == "__main__":
	Dial = raw_input()
	time = 0

	if 2 <= len(Dial) or len(Dial) <=15:
		for i in range(0,len(Dial)):
			for j in range(2,10):
				if ord(Dial[i]) in dl[str(j)]:
					time += j+1	

	
	print time
			
