n = int(input()) ans = [] for i in range(n): for j in range(i + 1, n - i): ans.append((i + 1, j + 1)) print(len(ans)) for u, v in ans: print(u, v)