sm = input()
m = []
s = 0
am = 0
for i in range(12):
m.append(list(map(float,input().split())))
a = 10
for i in range(1,12):
for j in range(11,a,-1):
s += m[i][j]
am += 1
a -= 1
if sm == 'S':
print("%.1lf"%s)
elif sm == 'M':
print("%.1lf"%(s/am))