"use strict";

const main = arg => {
    let arg1 = Number(arg);
    let result = arg1 + Math.pow(arg1, 2) + Math.pow(arg1, 3);
    console.log(result)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));  