var
	n, i, j : integer;
begin
	assign(input, 'proof.in');
	reset(input);
	assign(output, 'proof.out');
	rewrite(output);
	readln(n);
	if (n < 1) or (n > 100) then halt(1);
	writeln(n * (n - 1) div 2 + n - 1);
	for i := 1 to n do begin
		for j := 1 to i - 1 do begin
			writeln(j, ' ', i);
		end;
	end;
	for i := 1 to n - 1 do begin
		writeln(i + 1, ' ', i);
	end;
	close(input);
	close(output);
end.