#include <cstdio>
int main()
{
char t;
scanf("%c", &t);
double a[12][12];
for (int i = 0; i < 12; i++)
{
for (int j = 0; j < 12; j++) scanf("%lf", &a[i][j]);
}
int c = 0;
double sum = 0;
for (int i = 0; i < 5; i++)
{
for (int j = i + 1; j < 11 - i; j++)
{
sum += a[i][j];
c ++;
}
}
if (t == 'S') printf("%.1lf", sum);
else printf("%.1lf", sum / c);
return 0;
}