class cal
{
int m = 1;
public int f()
{
int m = 1,sum = 0;
for(int i = 1; i < 7; i++)
{
m = 1;
for(int j = 1; j <= i; j++)
{
m = m * j;
}
sum = sum + m;
}
return sum;
}
}
public class tanhe
{
public static void main(String[] args)
{
int m;
cal aa = new cal();
System.out.printf("1!+ 2!+ 3!+...+6! = %d", aa.f());
}
}
//873