n = int(input()) assert(2 <= n <= 500) 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: print(u, v)