~~~
t = input()
a = []
for i in range(12):
row = list(map(float,input().split()))
a.append(row)
s = 0
c = 0
for i in range(5):
for j in range(i+1,11-i):
s += a[i][j]
c += 1
if t == ‘M’:
s /= c
print(“%.1lf”%s)