#include using namespace std; /* alias */ // type using ull = unsigned long long; using ll = long long; using ld = long double; // pair using pii = pair; // vector using vi = vector; using vl = vector; using vll = vector; using vvi = vector; using vvl = vector; using vvll = vector; using vs = vector; using vpii = vector; /* define short */ #define mp make_pair #define all(obj) (obj).begin(), (obj).end() #define YesNo(bool) if(bool){cout<<"Yes"<=0;i--) #define rrepd(i,n) for(ll i=n;i>=1;i--) //定数 #define inf 2147483647; #define INF 9223372036854775807; /* func */ inline int in_int() {int x; cin >> x; return x;} inline ll in_ll() {ll x; cin >> x; return x;} inline double in_double() {{double x; cin >> x; return x;}} inline string in_str() {string x; cin >> x; return x;} inline int ctoi(char c) {return c - '0';} templatebool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } templatebool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } template map prime_factor(T n) { map ret; for (T i = 2; i * i <= n; i++) { T tmp = 0; while (n % i == 0) { tmp++; n /= i; } ret[i] = tmp; } if (n != 1) ret[n] = 1; return ret; } /* divisor_num(n) 入力:整数 n 出力:nの約数の個数 計算量:O(√n) */ template T divisor_num(T N) { map pf = prime_factor(N); T ret = 1; for (auto p : pf) { ret *= (p.second + 1); } return ret; } int main() { ll n, k; cin >> n >> k; n-=k; if (k != 0 ) { cout << divisor_num(n) -1 << endl; }else { cout << divisor_num(n) << endl; } }