main = readLn >>= print . (\x -> max 1 (mod (div (x*(x-1)) 2) x))