'use strict';
let price = [];
let answer = 0;
// let answer;
function main(input) {
    const num = parseInt(input)
	console.log(num+num**2+num**3)
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'))