long n;main(){n=scanf("%d",&n)>printf("%ld",(90+77*++n+n*n*n*((10+15*n)*(14+n*n)+88*n*n))*n/630);}