#include <cstdio>
int main() {
double M[12][12];
char c;
double res = 0;
scanf("%c", &c);
int cnt = 0;
for (int i = 0; i < 12; i++) {
for (int j = 0; j < 12; j++) {
scanf("%lf", &M[i][j]);
if (i < j && i + j >= 12) res += M[i][j], cnt++;
}
}
if (c == 'M') res /= cnt;
printf("%.1lf", res);
return 0;
}