#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

const ll INF = 1LL << 62;
const double PI = acos(-1);
const double eps = 1e-10;

int main() {
  vector<string> dow = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
  string s;
  cin >> s;
  cout << 7 - distance(dow.begin(), find(dow.begin(), dow.end(), s)) << endl;
  return 0;
}

#include <iostream>
#include <string>

int main() {
std::string str;
std::cin >> str;
  if (str == "MON") {
    std::cout << 6;
  }
  if (str == "TUE") {
    std::cout << 5;
  }
  if (str == "WED") {
    std::cout << 4;
  }
  if (str == "THU") {
    std::cout << 3;
  }
  if (str == "FRI") {
    std::cout << 2;
  }
  if (str == "SAT") {
    std::cout << 1;
  }
  if (str == "SUN") {
    std::cout << 7;
  }
}