const
  MAXN = 100;
var
  i, j, n, m : integer;
begin
  reset(input, 'proof.in');
  rewrite(output, 'proof.out');
  read(n);
  assert((2 <= n) and (n <= MAXN));
  m := n * (n - 1) div 2 + n - 1;
  writeln(m);
  for i := 1 to n do begin
    for j := i + 1 to n do begin
      writeln(i, ' ', j);
    end;
  end;
  for i := 1 to n - 1 do begin
    writeln(i + 1, ' ', i);
  end;
end.