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