#include <iostream>
using namespace std;
int main()
{
double a[12][12], sum = 0;
char c;
cin >> c;
for(int i = 0; i <12; i ++)
{
for (int j = 11; j >=0; j --)
{
cin >> a[i][j];
if(i<j)
sum = sum + a[i][j];
}
}
if(c =='S') printf("%.1lf",sum);
else printf("%.1lf",sum/66.0);
return 0;
}