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

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