package No400番台; import java.util.Scanner; public class Q411 { public static void main(String[] args) { new Q411().solver(); } void solver() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); if (K == 1&&N==2) { System.out.println(0); return; } long ans = 0; for (int i = 0; i <= N - K; i++) { ans += nCk(N - K, i); } System.out.println(ans); } static long nCk(int n, int k) { if (n < k) return 0; else { return (fact(n) / fact(n - k) / fact(k)); } } static long fact(int n) { long ans = 1; for (int i = 1; i <= n; i++) ans *= i; return ans; } }