"use strict";

function main(input) {
  input = input.trim();
  let num = parseInt(input);
  const result = num + num ** 2 + num ** 3;
  console.log(result);
}

function numberSort(array) {
  array.sort(f);
  return array;
}

var f = function (a, b) {
  return a - b;
};

main(require("fs").readFileSync("/dev/stdin", "utf-8"));
