package main import . "fmt" func main() { var n int Scan(&n) Println(string("285714"[(n-1)%6])) }