using System;
class xunhuan
{
static public long sum=1;
static public long sumall=1;
static void Main()
{
Console.WriteLine("Please input max N:");
int iRead=int.Parse(Console.ReadLine());
for(int i=2;i<=iRead;i++)
{
sum=sum*i;//
sumall+=sum;
}
Console.WriteLine("The result is "+sumall);
}
}