#include<stdio.h>
int fact (int x){
  int p = 1;
  for (int i = x; i > 1; i--){
    p = p*i;
  }
  return(p);
}
int comb (int n,int r){
  int p = 0;
  p = ( fact(n)/( fact(n-r) * fact(r) ));
  return(p);
}
int main(){
  int n,r,sum =0;
  scanf("%d %d",&n,&r);
  for (int i = r ; i <= n ; i++){
    sum = sum + comb (n+1,i);
  }
  printf("%d", sum);
  return(0);
}

  