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