fun main(){println("285714"[readLine()!!.toInt()-1])}