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

int main() {
  vector<string> S = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
  string s;
  cin >> s;

  for (int i = 0; i < 7; ++i) {
    if (s == S.at(i)) cout << 7-i << endl;
  }
}