from itertools import combinations def main(): N = int(input()) edges = [] for i, j in combinations(range(N), 2): if abs(i - j) > 0 and i + j < N: edges.append((i, j)) print(len(edges)) for edge in edges: print(edge[0] + 1, edge[1] + 1) if __name__ == "__main__": main()