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