N=int(input()) X=[] j=N+1 for i in range(1,N): for x in range(i+1,j): X.append((i,x)) j-=1 print(len(X)) for x,y in X: print(x,y)