1age=[]
2for i in range(20):
3 n=input()
4 if(n == ""):
5 break
6 elif(int(n) in range(0,120)):
7 age.append(int(n))
8 else:
9 print("invalid input")
10 exit()
11fee=0
12for i in age:
13 if i in range(1,17):
14 fee =fee+200
15 elif(i in range(18,40)):
16 fee=fee+400
17 else:
18 fee=fee+300
19print(fee)