import java.util.Scanner object Main extends App { val sc = new Scanner(System.in) val n = sc.nextInt println(n - 1) val ans = (1 until n).foreach(i => println(s"$i ${i + 1}")) }