N = int(input()) M = (N-1)*N//2 for x in range(M, 0, -1): if M % x == 0: break print(x)