#include"stdio.h"
main()
{
int s,i,t;
s=1;i=1;t=0;
while(i<=8)
s=s*i;
t=t+s;
i=i+1;
}
printf("%d\n",t);