using System; using System.Collections.Generic; using System.Linq; class Program { static string ReadLine() { return Console.ReadLine(); } static int ReadInt() { return int.Parse(ReadLine()); } static int[] ReadInts() { return ReadLine().Split().Select(int.Parse).ToArray(); } static string[] ReadStrings() { return ReadLine().Split(); } static long Combination(int n, int r) { long num = 1; long den = 1; for (int i = 0; i < r; i++) { num *= n - i; den *= r - i; } return num / den; } static long Calc(int n, int k) { if (k == 1) return 0; long sum = 0; int p = n - k; for (int i = 0; i <= p; i++) { sum += Combination(p, i); } return sum; } static void Main() { var xs = ReadInts(); int n = xs[0], k = xs[1]; Console.WriteLine(Calc(n, k)); } }