#include <iostream>
using namespace std;
int main(){
char op[5]; cin >> op;
double sum = 0.0;
for(int i = 0; i < 12; i ++ ){
for(int j = 0; j < 12; j ++ ){
double tmp; cin >> tmp;
if(i > j) sum += tmp;
}
}
if(op[0] == 'M') sum /= (12 * 11 / 2);
printf("%.1lf", sum);
return 0;
}