N = int(eval(input()))

ans = []

for i in range(1,N):

    for j in range(i+1,N+1):

        if i+j!=(N//2)*2+1:       

            ans.append([i,j])



print((len(ans)))

for a,b in ans:

    print((a,b))
N = int(input())

ans = []

for i in range(1,N):

    for j in range(i+1,N+1):

        if i+j!=(N//2)*2+1:

            ans.append([i,j])



print(len(ans))

[print(a,b) for a,b in ans]

N = int(eval(input()))
ans = []
for i in range(1, N):
    for j in range(i + 1, N + 1):
        if i + j != (N // 2) * 2 + 1:
            ans.append([i, j])
print((len(ans)))
for a, b in ans:
    print((a, b))

N = int(input())
ans = []
for i in range(1, N):
    for j in range(i + 1, N + 1):
        if i + j != (N // 2) * 2 + 1:
            ans.append([i, j])
print(len(ans))
[print(a, b) for a, b in ans]

-N = int(eval(input())) +N = int(input()) -print((len(ans))) -for a, b in ans: -    print((a, b)) +print(len(ans)) +[print(a, b) for a, b in ans]