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

  