import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		/*
		 * Scannerで値取得。
		 */
		Scanner row = new Scanner(System.in);

		//値取得
		String rows = row.next();

		row.close();
		
		//表示する値を格納する
		int show = 0;
		
		//入力に対応する日数を格納する
		switch(rows){
			case "SUN":
				show = 7;
				break;
			case "MON":
				show =6;
				break;
			case "TUE":
				show =5;
				break;
			case "WED":
				show =4;
				break;
			case "THU":
				show =3;
				break;
			case "FRI":
				show =2;
				break;
			case "SAT":
				show =1;
				break;
				
		}
		
		//表示
		System.out.println(show);

	}

}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz