//PascalABC.Net 3.2
function pow(n: integer; a: integer): biginteger;
begin
var prod:biginteger:=1;
for var i:=1 to a do prod*=n;
result:=prod;
end;
begin
var x:=readinteger('x =');
write ('s = ', pow(x, 3)+pow(x, 5)+pow(x, readinteger('n =')));
end.