```cpp
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
double a[12][12];
int main(){
int i,j,t,l;
double sum=0;
char ch;
cin>>ch;//输入字符啊!!
for(i=0;i<12;i++){
for(j=0;j<12;j++){
cin>>a[i][j];
}
}
for(i=0;i<12;i++){
for(j=0;j<11-i;j++){
sum+=a[i][j];
}
}
if(ch=='S'){
printf("%.1lf",sum);
}
else if(ch=='M'){
printf("%.1lf",sum/66);
}
return 0;
}