let f x = let circulation = "285714" let size = circulation.Length circulation.[x%size-1] let N = stdin.ReadLine() |> int f N |> stdout.WriteLine