N = int(input()) print(N-1) for i in range(N-1): print(1, i+2)