#include<stdio.h>int main(){ int num,i,k=1; int count=0; scanf("%d",&num); for(i=1;i<=num;i++) { k=i*k; count+=k; } printf("%d",count); return 0;}