#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
long long readInt(long long l,long long r,char endd){
	long long x=0;
	int cnt=0;
	int fi=-1;
	bool is_neg=false;
	while(true){
		char g=getchar();
		if(g=='-'){
			assert(fi==-1);
			is_neg=true;
			continue;
		}
		if('0'<=g && g<='9'){
			x*=10;
			x+=g-'0';
			if(cnt==0){
				fi=g-'0';
			}
			cnt++;
			assert(fi!=0 || cnt==1);
			assert(fi!=0 || is_neg==false);
 
			assert(!(cnt>19 || ( cnt==19 && fi>1) ));
		} else if(g==endd){
			if(is_neg){
				x= -x;
			}
			assert(l<=x && x<=r);
			return x;
		} else {
			assert(false);
		}
	}
}
string readString(int l,int r,char endd){
	string ret="";
	int cnt=0;
	while(true){
		char g=getchar();
		assert(g!=-1);
		if(g==endd){
			break;
		}
		cnt++;
		ret+=g;
	}
	assert(l<=cnt && cnt<=r);
	return ret;
}
long long readIntSp(long long l,long long r){
	return readInt(l,r,' ');
}
long long readIntLn(long long l,long long r){
	return readInt(l,r,'\n');
}
string readStringLn(int l,int r){
	return readString(l,r,'\n');
}
string readStringSp(int l,int r){
	return readString(l,r,' ');
}

long long P10(int x){
  return x == 0 ? 1 : 10 * P10(x - 1);
}

template <typename T, typename R = long long> 
vector<T> readArr(int len, R l, R r){
  vector<T> a(len);
  for(int i = 0; i < len; i++){
    if(i + 1 < len){
      a[i] = readIntSp(l, r);
    } else {
      a[i] = readIntLn(l, r);
    }
  }
  return a;
}

int main(){
  map<ll, int> q;
  auto decomp = [&](ll v){
    for(ll x = 2; x * x <= v; x++){
      while(v % x == 0){
        q[x]++;
        v /= x;
      }
    }
    if(v != 1){
      q[v]++;
    }
  };
  ll x = readIntSp(1, P10(12));
  ll y = readIntLn(1, P10(12));
  decomp(x);
  decomp(y);
  ll ans = 1;
  for(auto [k, v] : q){
    ans *= (v + 1);
  }
  cout << ans << '\n';
  return 0;
}