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