first = input() firstdata = first.split(" ") result = 0 for num in range(len(firstdata)): if int(firstdata[num])% 3 ==0: result = result + 4 if int(firstdata[num])%5 ==0: result = result+ 4 if not(int(firstdata[num])%3==0 or int(firstdata[num])%5==0): result = result+ len(firstdata[num]) print(result)