import java.math.BigInteger;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
BigInteger b = BigInteger.valueOf(0);
int n = sc.nextInt();
for(int i=1;i<=n;i++){
BigInteger a = BigInteger.valueOf(1);
for(int j = 1;j<=i;j++){
BigInteger c = BigInteger.valueOf(j);
a = a.multiply(c);
}
b = b.add(a);
}
System.out.println(b);
}
}