var
  n  : byte;
  sum: integer;

begin
  readln(n);
  for i: byte := 1 to n do
    sum := sum + i;
  writeln(6 * sum);
end.