#include <iostream>
#include <string>
#include <map>

int main(){
    std::string s;
    std::cin >> s;

    std::map<std::string, int> day = {
        {"SUN", 0},
        {"MON", 1},
        {"TUE", 2},
        {"WED", 3},
        {"THU", 4},
        {"FRI", 5},
        {"SAT", 6}
    };

    std::cout << 7 - day[s] << std::endl;

    return 0;
}
#include<bits/stdc++.h>
using namespace std;

int main(){
  long long int N, K, X;
  string S;
  cin >> S;
  if(S == "SUN") cout << 7 << endl;
  if(S == "MON") cout << 6 << endl;
  if(S == "TUE") cout << 5 << endl;
  if(S == "WED") cout << 4 << endl;
  if(S == "THU") cout << 3 << endl;
  if(S == "FRI") cout << 2 << endl;
  if(S == "SAT") cout << 1 << endl;
}
