import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] array = new int[n];
int sum = 0;
int num = 1;
for(int i = 1 ; i <= n ; i++) {
num *=i;
array[i-1] = num;
}
for(int i = 0 ; i < n ; i++) {
sum += array[i];
}
System.out.println(sum);
}
}