#include int main() { int n, k; scanf("%d%d", &n, &k); printf("%d\n", (1 << (n - k)) - (k == 1 ? n : 0) ); return 0; }