{$apptype console}
{$o-,r+,q+}
uses
  sysutils, math;

type
  int = longint;

var
  n : int;
  i : int;

begin
  n := strtoint(paramstr(1));
  writeln(n);
  for i := 1 to n - 1 do
  begin
    writeln(i, ' ', i + 1);
  end;
end. 