#yuki1519 n=int(input()) t=[] for i in range(n//2): for j in range(i+1,n-i): t.append((i+1,j+1)) print(len(t)) for x,y in t: print(x,y)