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(11):
for j in range(i+1,12):
s += a[i][j]
c += 1
if t == ‘M’:
s /= c
print(“%.1lf”%s)