#include using namespace std; typedef unsigned long long ullong; ullong fact( ullong k, ullong s ); ullong fact( ullong k ); ullong fact( ullong k ) { return fact(k, 1); } ullong fact( ullong k, ullong s ) { if( k == 0 ) return 1; ullong f = 1; for( ullong i=s; i<=k; i++ ) f *= i; return f; //return k * fact(k-1, s); } int main( int argc, char **argv ) { ullong n, k; while( cin >> n >> k ) { ullong comb; if( (k == 0) || (k == n) ) { comb = 1; } else { if( k < (n-k) ) { comb = fact(n,n-k+1) / fact(k); } else { comb = fact(n,k+1) / fact(n-k); } } ullong count = 0; for( ullong i=1; i<=comb; i++ ) { if( (comb % i) == 0 ) count++; } cout << count << endl; } return 0; }