const Main = input => {
  const inputNumber = Number(input);
  const result = inputNumber + inputNumber**2 + inputNumber ** 3;
  console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
