s=input() def c(i):return s.count(str(i)) print(len(s)*2+c(0)+c(4)+c(6)+c(8)*2+c(9)+1)