import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int N = input.nextInt(); long sum = 0, num; int i, j; for(i = 1; i <= N; i++) { num = 1; for(j = 1; j <= i; j++) { num = num * j; } sum += num; } System.out.print(sum); input.close(); } }