func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
let ans=readLine()!
let week=["SUN","MON","TUE","WED","THU","FRI","SAT"]
var num=0
for s in week{
  if(ans==s){print(7-num)}
  num+=1
}