function Main(input) {
  switch (input) {
    case 'SUN':
      console.log(7)
      break
    case 'MON':
      console.log(6)
      break
    case 'TUE':
      console.log(5)
      break
    case 'WED':
      console.log(4)
      break
    case 'THU':
      console.log(3)
      break
    case 'FRI':
      console.log(2)
      break
    default:
      console.log(1)
      break
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));