#include <iostream>
using namespace std;
int main()
{
double a[12][12],t = 0.0,cout = 0;
string menu;
cin >> menu;
for (int i = 0 ;i<=11;i++)
{
for (int j = 0;j<=11;j++)
cin >> a[i][j];
}
for (int i = 0 ;i <= 11; i++)
{
for (int j = 0;j<=11;j++)
if(i + j >= 12)
{
t += a[i][j];
cout += 1 ;
}
}
if (menu == "S") printf("%.1lf",t);
else printf("%.1lf",t/cout);
}