import java.util.Scanner;
class Main{
	static Scanner sc = new Scanner(System.in);
  public static int nextSunday(String str){
      	final int SUNDAY = 7;
  	switch(str){
      case "SUN":
          return SUNDAY - 0;
      case "MON":
          return SUNDAY - 1;
      case "TUE":
          return SUNDAY - 2;
      case "WED":
          return SUNDAY - 3;
      case "THU":
          return SUNDAY - 4;
      case "FRI":
          return SUNDAY - 5;
      default:
        return 1;
    }
  }
  public static void main(String[] args){
  	final int SUNDAY = 7;
    String str = sc.next();
    System.out.println(nextSunday(str));
  }
}
/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