include[HTML_REMOVED]
int main()
{
char c;
scanf("%c",&c);
double a[12][12];
for(int i =0;i<12;i++){
for(int j =0;j<12;j++)
{
scanf("%lf",&a[i][j]);
}
}
double sum;
double average;
for(int i =0;i<12;i++)
{
for(int j =0;j<12;j++)
{
if(j+i<11)
sum += a[i][j];
}
}
if(c=='S') {
printf("%.1lf",sum);
}else if(c=='M'){
printf("%.1lf",sum/66);
}
return 0;
}
//i+j<11