let A = stdin.ReadLine().Trim() |> int printfn "%d" <| if A < 9 then -1 else A - 7