import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char c = sc.next().charAt(0);
double res = 0;
for (int i = 0; i < 12; i++) {
for (int j = 0; j < 12; j++) {
double d = sc.nextDouble();
if (j > i) {
res += d;
}
}
}
if (c == 'S') {
System.out.printf("%.1f", res);
}
else {
System.out.printf("%.1f", res / 66);
}
}
}