import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); int n2 = n / 2; List list = new ArrayList<>(); int x = n - 1; for (int i = 1; i <= n2; i++) { for (int j = 1; j <= x; j++) { list.add(i + " " + (i + j)); } x -= 2; } PrintWriter pw = new PrintWriter(System.out); pw.println(list.size()); for (String s : list) { pw.println(s); } pw.flush(); } }