Language: C++

    #include <math.h>
    #include <time.h>
    #include <ctype.h>
    #include <stdio.h>
    #include <assert.h>
    #include <stdlib.h>
    #include <string.h>
    #include <map>
    #include <set>
    #include <deque>
    #include <queue>
    #include <stack>
    #include <bitset>
    #include <string>
    #include <vector>
    #include <iostream>
    #include <algorithm>
    #include<iomanip>
     
    #define mod 1000000007
    #define ll long long int
    #define pb(x) push_back(x)
    #define MP(x,y) make_pair(x,y)
     
    using namespace std;
     
    ll power(ll a, ll b, ll m)
    {
    	if (b == 0)
    		return(1);
    	ll sol = power(a, b / 2, m);
    	sol = (sol * sol) % m;
    	if (b % 2 == 1)
    		sol = (sol * a) % m;
    	return(sol);
    }
     
    ll gcd(ll a, ll b)
    {
    	if (b == 0)
    		return a;
    	else
    	{
    		return gcd(b, a % b);
    	}
    }
    void solve()
    {
    	ll a,b,ans=1;
    	cin >> a >> b;
    	ll g = gcd(a, b);
    	for (ll i = 2; i <= 1000000; i++)
    	{
    		if (g % i)
    			continue;
    		ans++;
    		while (g % i == 0)
    		{
    			g = g / i;
    		}
    	}
    	if (g > 1)
    		ans++;
    	cout << ans;
    }
    int main()
    {
    	int t = 1;
    	//cin >> t;
    	while (t--)
    	{
    		solve();
    	}
    	return 0;
    }

#include <math.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include<iomanip>

#define mod 1000000007
#define ll long long int
#define pb(x) push_back(x)
#define MP(x,y) make_pair(x,y)

using namespace std;

ll power(ll a, ll b, ll m)
{
	if (b == 0)
		return(1);
	ll sol = power(a, b / 2, m);
	sol = (sol * sol) % m;
	if (b % 2 == 1)
		sol = (sol * a) % m;
	return(sol);
}

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
	{
		return gcd(b, a % b);
	}
}
void solve()
{
	ll a,b,ans=1;
	cin >> a >> b;
	ll g = gcd(a, b);
	for (ll i = 2; i <= 1000000; i++)
	{
		if (g % i)
			continue;
		ans++;
		while (g % i == 0)
		{
			g = g / i;
		}
	}
	if (g > 1)
		ans++;
	cout << ans;
}
int main()
{
	int t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}

// #7786788

Compiler output:
a.cc:103:4: error: redefinition of 'long long int power(long long int, long long int, long long int)'
  103 | ll power(ll a, ll b, ll m)
      |    ^~~~~
a.cc:27:8: note: 'long long int power(long long int, long long int, long long int)' previously defined here
   27 |     ll power(ll a, ll b, ll m)
      |        ^~~~~
a.cc:114:4: error: redefinition of 'long long int gcd(long long int, long long int)'
  114 | ll gcd(ll a, ll b)
      |    ^~~
a.cc:38:8: note: 'long long int gcd(long long int, long long int)' previously defined here
   38 |     ll gcd(ll a, ll b)
      |        ^~~
a.cc:123:6: error: redefinition of 'void solve()'
  123 | void solve()
      |      ^~~~~
a.cc:47:10: note: 'void solve()' previously defined here
   47 |     void solve()
      |          ^~~~~
a.cc:142:5: error: redefinition of 'int main()'
  142 | int main()
      |     ^~~~
a.cc:66:9: note: 'int main()' previously defined here
   66 |     int main()
      |         ^~~~