var n,i:longint;
t:int64;
f:text;
//
function pow(x:longint):int64;
begin
exit(x*x*x);
end;
//
begin
assign(f,'POW.INP');
reset(f);
readln(f,n);
close(f);
t:=0;
for i:=1 to 1000 do
if pow(i+1)<=n then inc(t,i*(pow(i+1)-i*i*i))
else if (i*i*i<=n) and (n<pow(i+1)) then begin
t:=t+i*(n-pow(i)+1);
break;
end;
assign(f,'POW.OUT');
rewrite(f);
write(f,t);
close(f);
end.