#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, d, a[1005], wynik = 0;
    cin >> n >> d;
    for(int i=0; i<n; i++) {
        cin >> a[i];
    }
    sort(a, a+n);
    if(d >= a[n-1]) {
        cout << n*(n-1);
        return 0;
    }
    for(int i=0; i<n-1; i++) {
        if(abs(a[i]-a[i+1]) <= d) {
            wynik++;
        }
    }
    cout << wynik*2;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, d, a[1005], wynik = 0;
    cin >> n >> d;
    for(int i=0; i<n; i++) {
        cin >> a[i];
    }
    sort(a, a+n);
    if(d > a[n-1]) {
        cout << n*(n-1);
        return 0;
    }
    for(int i=0; i<n-1; i++) {
        if(abs(a[i]-a[i+1]) <= d) {
            wynik++;
        }
    }
    cout << wynik*2;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	vector<int> solHeight;
	int n, index, maxHeight, sum = 0;
	cin >> n >> maxHeight;
	index = n;

	while(n--) {
		int temp;
		cin >> temp;
		solHeight.push_back(temp);
	}

	sort(solHeight.begin(), solHeight.end());

	for(int i = 0; i < index; i++) {
		if (i == index - 1) {
			continue;
		}

		if (solHeight[i + 1] - solHeight[i] <= maxHeight) {
			 sum += 2;
		 }
	 }

	 cout << sum;

}


#include <bits/stdc++.h>

using namespace std;

int main() {
	vector<int> solHeight;
	int n, index, maxHeight, sum = 0;
	cin >> n >> maxHeight;
	index = n;

	while(n--) {
		int temp;
		cin >> temp;
		solHeight.push_back(temp);
	}

	sort(solHeight.begin(), solHeight.end());

	for(int i = 0; i < index; i++) {
		if (i == index - 1) {
			continue;
		}
		for (int j = i + 1; j < index; j++) {
			if (solHeight[j] - solHeight[i] <= maxHeight) {
				//cout << "SolHeight[i] : " << solHeight[i] << "	SolHeight[j] : " << solHeight[j] << endl;
				sum += 2;
			}
			else {
				break;
			}

		}
	}

	 cout << sum;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	vector<int> solHeight;
	int n, index, maxHeight, sum = 0;
	cin >> n >> maxHeight;
	index = n;

	while(n--) {
		int temp;
		cin >> temp;
		solHeight.push_back(temp);
	}

	sort(solHeight.begin(), solHeight.end());

	for(int i = 0; i < index; i++) {
		if (i == index - 1) {
			continue;
		}
		for (int j = i + 1; j < index; j++) {
			if (j == index - 1) {
				continue;
			}
			if (solHeight[j] - solHeight[i] <= maxHeight) {
				sum += 2;
			}
			else {
				break;
			}

		}
	}

	 cout << sum;
}


# include <bits/stdc++.h>
using namespace std;
int main ( ) {
	int M,N,s=0;
	cin>>N>>M;
	int a[N];
	 for (int k=0;k<N;k++)
	  cin>>a[k];
	  sort(a,a+N);
	for(int i=0;i<N-1;i++)
    	for(int j=i+1;j<N;j++)
    		if(abs(a[j]-a[i])<=M)
    			s++;
	cout<<s*2;
return 0;
}


# include <bits/stdc++.h>
using namespace std;
int main ( ) {
	int M,N,s=0;
	cin>>N>>M;
	int a[N];
	 for (int k=0;k<N;k++)
	  cin>>a[k];
	  sort(a,a+N);
	for(int i=0;i<N-1;i++)
    	for(int j=i+1;j<N;j++)
    		if(a[j]-a[i]<=M)
    			s++;
    		else
    		break;
	cout<<s*2;
return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
typedef long long ll;

int n, l, r;

ll fastpow(ll x, int y) {
	ll res = 1, base = x;
	while (y) {
		if (y&1) res *= base;
		base *= base;
		y >>= 1;
	}
	return res;
}

bool islegalq(ll q) {
	return fastpow(q, n-1) <= r;
}

int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}

int main() {
	cin >> n >> l >> r;
	if (n == 1) {
		cout << r-l+1; return 0;
	} else if (n == 2) {
		cout << (r-l+1)*(r-l); return 0;
	}
	ll sol = 0;
	for (int q = 2; islegalq(q); ++q) {
		for (int p = 1; p < q; ++p) {
			if (gcd(p, q) != 1) continue;
			int h = r / fastpow(q, n-1);
			int down = l / fastpow(p, n-1);
			if (down == 0) ++down;
			if (h > 0 && h >= down)
				sol += h-down+1;
		}
	}
	cout << sol*2;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#define ll long long
#define N 100010
using namespace std;
ll ksm(ll a,ll b)
{
    ll r=1;
    for(;b;b>>=1)
    {
        if(b&1) r=r*a;
        a=a*a;
        if(r>1e8) return 1e8;
    }
    return r;
}
int pw[N];
int gcd(int a,int b){return b==0?a:gcd(b,a%b);}
int main()
{
    int n,l,r;
    scanf("%d%d%d",&n,&l,&r);
    if(n>26){puts("0");return 0;}
    if(n==1){printf("%d\n",r-l+1);return 0;}
    if(n==2){printf("%lld\n",1ll*(r-l+1)*(r-l));return 0;}
    for(int i=1;(pw[i]=ksm(i,n-1))<=r;i++);
    long long ans=0;
    for(int i=1;pw[i]<=r;i++)
        for(int j=1;pw[j]<=r;j++)
        if(gcd(i,j)==1 && (i!=1 || j!=1))
        ans+=max(0,min(r/pw[i],r/pw[j])-max((l+pw[i]-1)/pw[i],(l+pw[j]-1)/pw[j])+1);
    printf("%lld",ans);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#define ll long long
#define N 60
using namespace std;
int ksm(ll a,ll b)
{
    ll r=1;
    for(;b;b>>=1)
    {
        if(b&1) r=r*a;
        a=a*a;
        if(r>1e8 || a>1e8) return 1e8;
    }
    return r;
}
int pw[N];
int gcd(int a,int b){return b==0?a:gcd(b,a%b);}
int main()
{
    int n,l,r;
    scanf("%d%d%d",&n,&l,&r);
    if(n>26){puts("0");return 0;}
    if(n==1){printf("%d\n",r-l+1);return 0;}
    if(n==2){printf("%lld\n",1ll*(r-l+1)*(r-l));return 0;}
    for(int i=1;(pw[i]=ksm(i,n-1))<=r;i++);
    long long ans=0;
    for(int i=1;pw[i]<=r;i++)
        for(int j=1;pw[j]<=r;j++)
        if(gcd(i,j)==1 && (i!=1 || j!=1))
        ans+=max(0,min(r/pw[i],r/pw[j])-max((l+pw[i]-1)/pw[i],(l+pw[j]-1)/pw[j])+1);
    printf("%lld",ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
typedef long long LL ;

LL power(int x, int n) {
    LL ans = 1LL;
    while(n --) {
        ans *= x;
    }
    return ans;
}

LL gcd(LL x, LL y) {
    if(y == 0) return x;
    else return gcd(y, x%y);
}

int main(void) {
    int n, l, r;
    cin >> n >> l >> r;
    if(n == 1) cout << (r-l+1) << endl;
    else if(n == 2) cout << (r-l+1)*(r-l) << endl;
    else if(n > 30) cout << 0 << endl;
    else {
        LL ans = 0;
        for(int i = 2; i * i <= r; i ++) {
            int _r = (r)/power(i, n-1);
            if(_r < 1) break;
            for(int j = 1; j < i; j ++) {
                int _l = (l-1) / power(j, n - 1) + 1;
                if(_l > _r) continue;
                if(gcd(i, j) == 1) {
                   ans += (_r - _l + 1);
                }
            }
        }
        cout << ans * 2 << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
typedef long long LL ;

LL power(int x, int n) {
    LL ans = 1LL;
    while(n --) {
        ans *= x;
    }
    return ans;
}

LL gcd(LL x, LL y) {
    if(y == 0) return x;
    else return gcd(y, x%y);
}

int main(void) {
    int n, l, r;
    cin >> n >> l >> r;
    if(n == 1) cout << (r-l+1) << endl;
    else if(n == 2) cout << (LL)(r-l+1)*(r-l) << endl;
    else if(n > 30) cout << 0 << endl;
    else {
        LL ans = 0;
        for(int i = 2; i * i <= r; i ++) {
            int _r = (r)/power(i, n-1);
            if(_r < 1) break;
            for(int j = 1; j < i; j ++) {
                int _l = (l-1) / power(j, n - 1) + 1;
                if(_l > _r) continue;
                if(gcd(i, j) == 1) {
                   ans += (_r - _l + 1);
                }
            }
        }
        cout << ans * 2 << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
typedef long long LL ;

LL power(int x, int n) {
    LL ans = 1LL;
    while(n --) {
        ans *= x;
    }
    return ans;
}

LL gcd(LL x, LL y) {
    if(y == 0) return x;
    else return gcd(y, x%y);
}

int main(void) {
    int n, l, r;
    cin >> n >> l >> r;
    if(n == 1) cout << (r-l+1) << endl;
    else if(n == 2) cout << (r-l+1)*(r-l) << endl;
    else if(n > 30) cout << 0 << endl;
    else {
        LL ans = 0;
        for(int i = 2; i * i <= r; i ++) {
            int _r = (r)/power(i, n-1);
            for(int j = 1; j < i; j ++) {
                if(power(j, n-1) < l) continue;
                int _l = (l)/(power(j, n-1));
                if(gcd(i, j) == 1) {
                   ans += (_r - _l + 1);
                }
            }
        }
        ans --;
        cout << ans * 2 << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define str string
#define pll pair<ll, ll>
#define fi first
#define se second
#define pb push_back
#define SET(a, b) memset(a, b, sizeof(a))
#define pq priority_queue
using namespace std;
bitset<3200> bs;
vector<ll> prime;
vector<pll> bud;
void sieve (ll a) {
	bs.set(); bs[0] = bs[1] = 0;
	for (ll b = 2; b <= a; b++) {
		if (!bs[b]) continue;
		prime.pb(b);
		for (ll c = b * b; c <= a; c += b) bs[c] = 0;
	}
	return;
}
int main () {
	ll a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q;
	scanf("%lld %lld %lld", &a, &b, &c);
	if (a == 1) {
		printf("%lld\n", c - b + 1);
		return 0;
	} else if (a == 2) {
		printf("%lld\n", (c - b + 1) * (c - b));
		return 0;
	}
	prime.pb(1); sieve(3200);
	for (i = 0; i < prime.size(); i++) {
		for (j = 1, d = 1, e = 1; j <= a - 1; j++) {
			d *= prime[i];
			if (d > c) {
				e = 0;
				break;
			}
		}
		if (!e) {
			prime.erase(prime.begin() + i, prime.end());
			break;
		}
		prime[i] = d;
		f = b / d; g = c / d;
		if (b % d) f++;
		bud.pb({f, g});
	}
	h = 0;
	for (i = 0; i < prime.size(); i++) {
		d = bud[i].fi; e = bud[i].se;
		for (j = i + 1; j < prime.size(); j++) {
			f = bud[j].fi; g = bud[j].se;
			if (d <= f && g <= e) h += (g - f + 1) * 2;
			else if (f <= d && e <= g) h += (e - d + 1) * 2;
			else if (d <= f && f <= e && e <= g) h += (e - f + 1) * 2;
			else if (f <= d && d <= g && g <= e) h += (g - d + 1) * 2;
		}
	}
	printf("%lld\n", h);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define str string
#define pll pair<ll, ll>
#define fi first
#define se second
#define pb push_back
#define SET(a, b) memset(a, b, sizeof(a))
#define pq priority_queue
using namespace std;
pll bud[3200];
ll gcd (ll a, ll b) {
	return ((b == 0) ? a : gcd(b, a % b));
}
int main () {
	ll a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q;
	scanf("%lld %lld %lld", &a, &b, &c);
	if (a == 1) {
		printf("%lld\n", c - b + 1);
		return 0;
	} else if (a == 2) {
		printf("%lld\n", (c - b + 1) * (c - b));
		return 0;
	}
	for (i = 1; ; i++) {
		for (j = 1, d = 1, e = 1; j < a; j++) {
			d *= i;
			if (d > c) {
				e = 0;
				break;
			}
		}
		if (!e) break;
		f = b / d; g = c / d;
		if (b % d) f++;
		bud[i] = {f, g}; m = i;
	}
	h = 0;
	for (i = 1; i <= m; i++) {
		d = bud[i].fi; e = bud[i].se;
		for (j = i + 1; j <= m; j++) {
			if (gcd(i, j) > 1) continue;
			f = bud[j].fi; g = bud[j].se;
			if (d <= f && g <= e) h += (g - f + 1) * 2;
			else if (f <= d && e <= g) h += (e - d + 1) * 2;
			else if (d <= f && f <= e && e <= g) h += (e - f + 1) * 2;
			else if (f <= d && d <= g && g <= e) h += (g - d + 1) * 2;
		}
	}
	printf("%lld\n", h);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define str string
#define pll pair<ll, ll>
#define fi first
#define se second
#define pb push_back
#define SET(a, b) memset(a, b, sizeof(a))
#define pq priority_queue
using namespace std;
ll power[3200];
pll bud[3200];
ll gcd (ll a, ll b) {
	return ((b == 0) ? a : gcd(b, a % b));
}
int main () {
	ll a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q;
	scanf("%lld %lld %lld", &a, &b, &c);
	if (a == 1) {
		printf("%lld\n", c - b + 1);
		return 0;
	} else if (a == 2) {
		printf("%lld\n", (c - b + 1) * (c - b));
		return 0;
	}
	for (i = 1; ; i++) {
		for (j = 1, d = 1, e = 1; j < a; j++) {
			d *= i;
			if (d > c) {
				e = 0;
				break;
			}
		}
		if (!e) break;
		power[i] = d;
		f = b / d; g = c / d;
		if (b % d) f++;
		bud[i] = {f, g}; m = i;
	}
	h = 0;
	for (i = 1; i <= m; i++) {
		d = bud[i].fi; e = bud[i].se;
		for (j = 1; j <= m; j++) {
			if (gcd(i, j) > 1 || i == j) continue;
			f = bud[j].fi; g = bud[j].se;
			if (d <= f && g <= e) h += g - f + 1;
			else if (f <= d && e <= g) h += e - d + 1;
			else if (d <= f && f <= e && e <= g) h += e - f + 1;
			else if (f <= d && d <= g && g <= e) h += g - d + 1;
		}
	}
	printf("%lld\n", h);
	return 0;
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define int ll
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
#define p 998244353
using namespace std;
inline ll read()
{
    register ll x = 0; char zf = 1; char ch;
	while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
signed main()
{
    n=r;int L=r,R=r;
	if(n==1)cout<<(R-L+1);
	if(n==2)cout<<(R-L+1)*(R-L+2)/2;
	if(n<=2)return 0;n--;ll ans=0;
	for(rt i=1;i<=10000;i++)
	for(rt j=1;j<=10000;j++)if(i!=j&&__gcd(i,j)==1)
	{
		ll e1=1;
		for(rt k=1;k<=n;k++)
		{
			e1=e1*i;
			if(e1>R)break;
		}
		if(e1>R)break;
		ll e2=1;
		for(rt k=1;k<=n;k++)
		{
			e2=e2*j;
			if(e2>R)break;
		}
		if(e2>R)break;
		if(e1>e2)swap(e1,e2);
		int first=(L-1)/e1+1;
		int last=R/e2;
		ans+=max(0ll,last-first+1);
	}
	cout<<ans;
	return 0;
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define int ll
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
#define p 998244353
using namespace std;
inline ll read()
{
    register ll x = 0; char zf = 1; char ch;
	while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
signed main()
{
    n=r;int L=r,R=r;
	if(n==1)cout<<(R-L+1);
	if(n==2)cout<<(R-L+1)*(R-L);
	if(n<=2)return 0;n--;ll ans=0;
	for(rt i=1;i<=10000;i++)
	for(rt j=i+1;j<=10000;j++)if(i!=j&&__gcd(i,j)==1)
	{
		ll e1=1;
		for(rt k=1;k<=n;k++)
		{
			e1=e1*i;
			if(e1>R)break;
		}
		if(e1>R)break;
		ll e2=1;
		for(rt k=1;k<=n;k++)
		{
			e2=e2*j;
			if(e2>R)break;
		}
		if(e2>R)break;
		if(e1>e2)swap(e1,e2);
		int first=(L-1)/e1+1;
		int last=R/e2;
		ans+=max(0ll,last-first+1);
	}
	cout<<ans*2;
	return 0;
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define int ll
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
#define p 998244353
using namespace std;
inline ll read()
{
    register ll x = 0; char zf = 1; char ch;
	while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
signed main()
{
    n=r;int L=r,R=r;
	if(n==1)cout<<(R-L+1);
	if(n==2)cout<<(R-L+1)*(R-L+1)/2;
	if(n<=2)return 0;n--;ll ans=0;
	for(rt i=1;i<=1000;i++)
	for(rt j=1;j<=1000;j++)if(i!=j&&__gcd(i,j)==1)
	{
		ll e1=1;
		for(rt k=1;k<=n;k++)
		{
			e1=e1*i;
			if(e1>R)break;
		}
		if(e1>R)break;
		ll e2=1;
		for(rt k=1;k<=n;k++)
		{
			e2=e2*j;
			if(e2>R)break;
		}
		if(e2>R)break;
		if(e1>e2)swap(e1,e2);
		int first=(L-1)/e1+1;
		int last=R/e2;
		ans+=max(0ll,last-first+1);
	}
	cout<<ans;
	return 0;
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define int ll
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
#define p 998244353
using namespace std;
inline ll read()
{
    register ll x = 0; char zf = 1; char ch;
	while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
signed main()
{
    n=r;int L=r,R=r;
	if(n==1)cout<<(R-L+1);
	if(n==2)cout<<(R-L+1)*(R-L);
	if(n<=2)return 0;n--;ll ans=0;
	for(rt i=1;i<=10000;i++)
	for(rt j=1;j<=10000;j++)if(i!=j&&__gcd(i,j)==1)
	{
		ll e1=1;
		for(rt k=1;k<=n;k++)
		{
			e1=e1*i;
			if(e1>R)break;
		}
		if(e1>R)break;
		ll e2=1;
		for(rt k=1;k<=n;k++)
		{
			e2=e2*j;
			if(e2>R)break;
		}
		if(e2>R)break;
		if(e1>e2)swap(e1,e2);
		int first=(L-1)/e1+1;
		int last=R/e2;
		ans+=max(0ll,last-first+1);
	}
	cout<<ans;
	return 0;
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define int ll
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
#define p 998244353
using namespace std;
inline ll read()
{
    register ll x = 0; char zf = 1; char ch;
	while (ch != '-' && !isdigit(ch)) ch = getchar();
    if (ch == '-') zf = -1, ch = getchar();
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar(); return x * zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int i,j,k,m,n,x,y,z,cnt;
signed main()
{
    n=r;int L=r,R=r;
	if(n==1)cout<<(R-L+1);
	if(n==2)cout<<(R-L+1)*(R-L+2)/2;
	if(n<=2)return 0;n--;ll ans=0;
	for(rt i=1;i<=1000;i++)
	for(rt j=1;j<=1000;j++)if(i!=j&&__gcd(i,j)==1)
	{
		ll e1=1;
		for(rt k=1;k<=n;k++)
		{
			e1=e1*i;
			if(e1>R)break;
		}
		if(e1>R)break;
		ll e2=1;
		for(rt k=1;k<=n;k++)
		{
			e2=e2*j;
			if(e2>R)break;
		}
		if(e2>R)break;
		if(e1>e2)swap(e1,e2);
		int first=(L-1)/e1+1;
		int last=R/e2;
		ans+=max(0ll,last-first+1);
	}
	cout<<ans;
	return 0;
}


#include <bits/stdc++.h>
#define PR pair<int,int>
#define MP make_pair
#define fi first
#define se second
#define ll __int64
const ll INF=1e18;
const int inf=0x3f3f3f3f;
const int N=62;
const double eps=1e-10;
using namespace std;
int n,l,r;
int power(int a,int n)
{
    int ans=1;
    while(n)
    {
        if(n&1)
        {
            if(ans>inf/a) return -1;
            ans*=a;
        }
        a*=a;
        n/=2;
    }
    return ans;
}
int gcd(int a,int b) {return b==0?a:gcd(b,a%b);}
int main()
{
    scanf("%d%d%d",&n,&l,&r);
    if(n==1)
    {
        printf("%d\n",r-l+1);
        return 0;
    }
    else if(n==2)
    {
        ll ans=(ll)(r-l)*(r-l+1);
        printf("%I64d\n",ans);
        return 0;
    }
    n--;
    ll ans=0;
    for(int i=1;i<=r;i++)
    {
        int p=power(i,n);
        if(p==-1||p>r) break;
        if(p<l) continue;
        for(int k=1;k*p<=r;k++)
        {
            int x=pow(1.0*r/k,1.0/n)+eps;
            if(x<=i) continue;
            for(int j=i+1;j<=x;j++)
            {
                if(gcd(i,j)==1) ans++;
            }
            printf("%d %d %d %I64d\n",i,k,x,ans);
        }
    }
    ans*=2;
    printf("%I64d\n",ans);
}


#include <bits/stdc++.h>
#define PR pair<int,int>
#define MP make_pair
#define fi first
#define se second
#define ll __int64
const ll INF=1e18;
const int inf=0x3f3f3f3f;
const int N=4000;
const double eps=1e-10;
using namespace std;
int n,l,r,upper,x,y,f[N];
ll Power(ll a,int n)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans*=a;
        a*=a;
        n/=2;
    }
    return ans;
}
int Gcd(int a,int b) {return b==0?a:Gcd(b,a%b);}
void Init()
{
    for(int i=1;i<=upper;i++)
    {
        f[i]=Power(i,n);
    }
}
int main()
{
    scanf("%d%d%d",&n,&l,&r);
    if(n==1)
    {
        printf("%d\n",r-l+1);
        return 0;
    }
    else if(n==2)
    {
        ll ans=(ll)(r-l)*(r-l+1);
        printf("%I64d\n",ans);
        return 0;
    }
    n--;
    ll ans=0;
    upper=pow(r,1.0/n)+eps;
    Init();
    for(y=1;y<=upper;y++)
    {
        for(x=y+1;x<=upper;x++)
        {
            if(Gcd(x,y)==1)
            {
                int tmp=(r/f[x])-((l-1)/f[y]);
                if(tmp>0) ans+=tmp;
            }
        }
    }
    ans*=2;
    printf("%I64d\n",ans);
}


#include <bits/stdc++.h>
#define PR pair<int,int>
#define MP make_pair
#define fi first
#define se second
#define ll __int64
const ll INF=1e18;
const int inf=0x3f3f3f3f;
const int N=62;
const double eps=1e-10;
using namespace std;
int n,l,r;
int power(int a,int n)
{
    int ans=1;
    while(n)
    {
        if(n&1)
        {
            if(ans>inf/a) return -1;
            ans*=a;
        }
        a*=a;
        n/=2;
    }
    return ans;
}
int main()
{
    scanf("%d%d%d",&n,&l,&r);
    if(n==1)
    {
        printf("%d\n",r-l+1);
        return 0;
    }
    n--;
    ll ans=0;
    for(int i=1;i<=r;i++)
    {
        int p=power(i,n);
        if(p==-1||p>r) break;
        if(p<l) continue;
        for(int k=1;k*p<=r;k++)
        {
            int x=pow(1.0*r/k,1.0/n)+eps;
            if(x<=i) continue;
            ans+=x-i;
        }
    }
    ans*=2;
    printf("%I64d\n",ans);
}


#include <bits/stdc++.h>
#define PR pair<int,int>
#define MP make_pair
#define fi first
#define se second
#define ll __int64
const ll INF=1e18;
const int inf=0x3f3f3f3f;
const int N=62;
const double eps=1e-10;
using namespace std;
int n,l,r;
int power(int a,int n)
{
    int ans=1;
    while(n)
    {
        if(n&1)
        {
            if(ans>inf/a) return -1;
            ans*=a;
        }
        a*=a;
        n/=2;
    }
    return ans;
}
int gcd(int a,int b) {return b==0?a:gcd(b,a%b);}
int main()
{
    scanf("%d%d%d",&n,&l,&r);
    if(n==1)
    {
        printf("%d\n",r-l+1);
        return 0;
    }
    else if(n==2)
    {
        ll ans=(ll)(r-l)*(r-l+1);
        printf("%I64d\n",ans);
        return 0;
    }
    n--;
    ll ans=0;
    for(int i=1;i<=r;i++)
    {
        int p=power(i,n);
        if(p==-1||p>r) break;
        if(p<l) continue;
        for(int k=1;k*p<=r;k++)
        {
            int x=pow(1.0*r/k,1.0/n)+eps;
            if(x<=i) continue;
            for(int j=i+1;j<=x;j++)
            {
                if(gcd(i,j)==1) ans++;
            }
            //printf("%d %d %d %I64d\n",i,k,x,ans);
        }
    }
    ans*=2;
    printf("%I64d\n",ans);
}


#include<bits/stdc++.h>
using namespace std;

int n, LT, RT;
const long long INF = 1e9;
bitset <3200> vis[3200];

bool OK_pow(int x, int y){
	long long tmp = 1;
	for(int i = 0; i < y; i ++){
		tmp *= x;
		if(tmp > (long long)RT){ return true; }
	}
	return false;
}

int pow(int x, int y){
	if(x == 1 || y == 0) return 1;
	int tmp = 1;
	while(y){
		if(y & 1) tmp *= x;
        y >>= 1;
        x = x * x;
	}
	return tmp;
}

int main(){
	cin >> n >> LT >> RT;
	int d = RT - LT + 1;
	if( n == 1 ) { cout << d << endl; return 0; }
	if( n == 2 ) { cout << (long long)d * (d + 1) / 2 << endl; return 0; }
	int top;
    for(top = 2;; top ++){
		if(OK_pow(top, n - 1)) break;
    }
    long long ans = 0;
    vis[0][1] = true;
    for(int i = 1; i < top; i ++){
		for(int j = i + 1; j < top; j ++){
			vis[i][j] = vis[j % i][i];
			if(!vis[i][j]) continue;
			int aa = pow(i, n - 1);
			int bb = pow(j, n - 1);
			ans += 2 * max(0, RT / bb - (LT - 1) / aa);
		}
    }
    cout << ans << endl;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

ll pow_mod(ll x, ll y) {
    ll ret = 1;
    while(y > 0) {
        if(y & 1) ret *= x;
        x *= x;
        y >>= 1;
    }
    return ret;
}

int main() {
    ll n, l, r, b, a, c, A, C, ans, i;
    scanf("%I64d%I64d%I64d", &n, &l, &r);
    if(n == 1) {printf("%I64d\n", r - l + 1); return 0;}
    if(n == 2) {printf("%I64d\n", (r - l + 1) * (r - l)); return 0;}
    b = 2;
    while(1) {
        c = 1;
        for(i = 1; i < n; i ++) {
            c = c * b;
            if(c > r) break;
        }
        if(i < n) break;
        b ++;
    }
    ans = 0;
    for(a = 1; a < b; a ++) for(c = a + 1; c < b; c ++) if(__gcd(a, c) == 1) {
        A = pow_mod(a, n - 1);
        C = pow_mod(c, n - 1);
        ans += max(0ll, r / C - (l + A - 1) / A + 1);
    }
    printf("%I64d\n", ans * 2);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

ll pow_mod(ll x, ll y) {
    ll ret = 1;
    while(y > 0) {
        if(y & 1) ret *= x;
        x *= x;
        y >>= 1;
    }
    return ret;
}

int main() {
    ll n, l, r, b, a, c, A, C, ans, i;
    scanf("%I64d%I64d%I64d", &n, &l, &r);
    if(n == 1) {printf("%I64d\n", r - l + 1); return 0;}
    if(n == 2) {printf("%I64d\n", (r - l + 1) * (r - l)); return 0;}
    b = 2;
    while(1) {
        c = 1;
        for(i = 1; i < n; i ++) {
            c = c * b;
            if(c > r) break;
        }
        if(i < n) break;
        b ++;
    }
    ans = 0;
    for(a = 1; a < b; a ++) for(c = a + 1; c < b; c ++) if(__gcd(a, c) == 1) {
        A = pow_mod(a, n - 1);
        C = pow_mod(c, n - 1);
        ans += max(0ll, r / C - (l + A - 1) / A + 1);
    }
    printf("%I64d\n", ans * 2);
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;
int gcd(int x,int y){
    return y==0?x:gcd(y,x%y);
}
int pow(int a,int n){
    LL res=1,t=a;
    while(n){
        if(n&1) res*=t;
        n/=2; t*=t;
    }
    return res;
}
int main(){
    LL n,l,r;
    while(cin>>n>>l>>r){
        if(n==1) cout<<r-l+1<<endl;
        else if(n==2){
            LL ans=(LL)(r-l+1)*(r-l);
            cout<<ans<<endl;
        }
        else{
            LL ans=0;
            for(int i=1;i<=sqrt(r);i++){
                for(int j=i+1;j<=sqrt(r);j++){
                    if(gcd(i,j)==1){
                        int L=ceil(1.0*l/pow(i,n-1));
                        int R=floor(1.0*r/pow(j,n-1));
                        if(R>=L) ans+=R-L+1;
                    }
                }
            }
            cout<<ans*2<<endl;
        }
    }

    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;
int gcd(int x,int y){
    return y==0?x:gcd(y,x%y);
}
int pow(int a,int n){
    LL res=1,t=a;
    while(n){
        if(n&1) res*=t;
        n/=2; t*=t;
    }
    return res;
}
int main(){
    LL n,l,r;
    while(cin>>n>>l>>r){
        if(n==1) cout<<r-l+1<<endl;
        else if(n==2){
            LL ans=(LL)(r-l+1)*(r-l);
            cout<<ans<<endl;
        }
        else if(n>=40) cout<<0<<endl;
        else{
            LL ans=0;
            for(int i=1;i<=sqrt(r);i++){
                for(int j=i+1;j<=sqrt(r);j++){
                    if(gcd(i,j)==1){
                        int L=ceil(1.0*l/pow(i,n-1));
                        int R=floor(1.0*r/pow(j,n-1));
                        if(R>=L&&R>0) ans+=R-L+1;
                    }
                }
            }
            cout<<ans*2<<endl;
        }
    }

    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;
int gcd(int x,int y){
    return y==0?x:gcd(y,x%y);
}
int pow(int a,int n){
    LL res=1,t=a;
    while(n){
        if(n&1) res*=t;
        n/=2; t*=t;
    }
    return res;
}
int main(){
    LL n,l,r;
    while(cin>>n>>l>>r){
        if(n==1) cout<<r-l+1<<endl;
        else if(n==2){
            LL ans=(LL)(r-l+1)*(r-l);
            cout<<ans<<endl;
        }
        else{
            LL ans=0;
            for(int i=1;i<=sqrt(r);i++){
                for(int j=i+1;j<=sqrt(r);j++){
                    if(gcd(i,j)==1){
                        int L=ceil(1.0*l/pow(i,n-1));
                        int R=floor(1.0*r/pow(j,n-1));
                        if(R>=L&&R>0) ans+=R-L+1;
                    }
                }
            }
            cout<<ans*2<<endl;
        }
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>pii;
typedef vector<int>vi;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define fi first
#define se second
#define de(x) cout<<#x<<"="<<x<<endl;
#define dd(x) cout<<#x<<"="<<x<<" " ;
#define pb(x) push_back(x)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
const int N=2e4+5;
ll pw[N][30];

int main()
{

	ll n,l,r;
	cin>>n>>l>>r;
	rep(i,1,4001)
		pw[i][0]=1;
	for(ll i=1;i<=4000;++i){
		for(ll j=1;j<28;++j){

			if(pw[i][j-1]>r)pw[i][j]=r+1;
			else pw[i][j]=pw[i][j-1]*i;

		}
	}
	if(n==1){
		cout<<r-l+1<<endl;
	}
	else if(n==2){
		ll len=r-l+1;
		ll cnt=len*(len-1);
		cout<<cnt<<endl;
	}
	else{
		ll cnt1=0;
		if(n>=25){
			cout<<0;
			return 0;
		}
		for(ll p=1;p<=sqrt(r);++p){
			for(ll q=p+1;q<=sqrt(r);++q){
				if(__gcd(p,q)==1){
					ll low=(l-1)/pw[p][n-1];
					ll hig=r/pw[q][n-1];

					ll t=max(0ll,hig-low);
					cnt1+=t;
				}
			}
		}
		cnt1=cnt1*2ll;
		cout<<cnt1<<endl;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>pii;
typedef vector<int>vi;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define fi first
#define se second
#define de(x) cout<<#x<<"="<<x<<endl;
#define dd(x) cout<<#x<<"="<<x<<" " ;
#define pb(x) push_back(x)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
const int N=2e6+5;
ll pw[N][30];

int main()
{

	ll n,l,r;
	cin>>n>>l>>r;
	rep(i,1,4001)
		pw[i][0]=1;
	for(ll i=1;i<=4000;++i){
		for(ll j=1;j<28;++j){

			if(pw[i][j-1]>r)pw[i][j]=r+1;
			else pw[i][j]=pw[i][j-1]*i;

		}
	}
	if(n==1){
		cout<<r-l+1<<endl;
	}
	else if(n==2){
		ll len=r-l+1;
		ll cnt=len*(len-1);
		cout<<cnt<<endl;
	}
	else{
		ll cnt1=0;
		if(n>=25){
			cout<<0;
			return 0;
		}
		for(ll p=1;p<=sqrt(r);++p){
			for(ll q=p+1;q<=sqrt(r);++q){
				if(__gcd(p,q)==1){
					ll low=(l-1)/pw[p][n-1];
					ll hig=r/pw[q][n-1];

					ll t=max(0ll,hig-low);
					cnt1+=t;
				}
			}
		}
		cnt1=cnt1*2ll;
		cout<<cnt1<<endl;

	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef long double ld;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

ll binpow(ll n, ll p) {
    if(p == 0) return 1ll;
    ll q = binpow(n, p / 2);
    q = min(ll(inf), 1ll * q * q);
    if(p % 2) q = min(ll(inf), 1ll * q * n);
    return q;
}

int const MAX_VAL = 10 * 1000 * 1000 + 5;

ll pref[MAX_VAL];

ll gcd(ll x, ll y) {
    return !x ? y : gcd(y % x, x);
}

int is_sqrt[MAX_VAL];

int main() {

    ll c, l, r;

    cin >> c >> l >> r;

    if(c == 1) {
        cout << r - l + 1 << "\n";
        return 0;
    }

    if(c == 2) {
        ll len = r - l + 1;
        cout << len * (len - 1) << "\n";
        return 0;
    }

    if(c == 3) {
        for(int i = 1;i * i < MAX_VAL;i++) is_sqrt[i * i] = i;
        ll result = 0;
        for(int z = l;z <= r;z++) {
            for(int x = is_sqrt[z] * is_sqrt[z] != z ? z : is_sqrt[z];x < MAX_VAL;x += z) {
                if(z < x) {
                    ll y = 1ll * x * x / z;
                    if(l <= z && z < x && x < y && y <= r) {
                        result++;
                    }
                }
            }
        }
        cout << 2 * result << "\n";
        return 0;
    }

    // pref[i] -> max x ^ (c - 1) <= i
    // suff[i] -> min x ^ (c - 1) >= i

    pref[0] = 0ll;
    pref[1] = 1ll;

    for(ll x = 2;x < MAX_VAL;x++) {
        pref[x] = pref[x - 1];
        while(binpow(pref[x] + 1, c - 1) <= x) {
            pref[x]++;
        }
    }

    ll result = 0;

    for(ll value, m, n = 1;(value = binpow(n, c - 1)) < MAX_VAL;n++) {
        for(ll b0 = value;b0 < MAX_VAL;b0 += n) {
            if(b0 % value) continue;
            if(b0 < l) continue;
            if(b0 > r) break;
            m = pref[int(ll(r) * ll(value) / ll(b0))];
            for(ll tmp_m = n + 1;tmp_m <= m;tmp_m++) {
                result += gcd(tmp_m, n) == 1;
            }
        }
    }

    cout << 2ll * result << "\n";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef long double ld;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

int binpow(int n, int p) {
    if(p == 0) return 1;
    int q = binpow(n, p / 2);
    q = min(ll(inf), 1ll * q * q);
    if(p % 2) q = min(ll(inf), 1ll * q * n);
    return q;
}

int const MAX_VAL = 10 * 1000 * 1000 + 5;

int pref[MAX_VAL];
int suff[MAX_VAL];

int main() {

    int c, l, r;

    cin >> c >> l >> r;

    if(c == 1) {
        cout << r - l + 1 << "\n";
        return 0;
    }

    // pref[i] -> max x ^ (c - 1) <= i
    // suff[i] -> min x ^ (c - 1) >= i

    pref[0] = 0;
    pref[1] = 1;

    for(int x = 2;x < MAX_VAL;x++) {
        pref[x] = pref[x - 1];
        while(1) {
            ll val = 1;
            for(int j = 0;j < c - 1 && val <= x;j++) {
                val *= ll(pref[x] + 1);
            }
            if(val <= x) {
                pref[x]++;
            }else {
                break;
            }
        }
    }

    for(int i = 0;i < MAX_VAL;i++) {
        if(binpow(pref[i], c - 1) == i) {
            suff[i] = pref[i];
        }else {
            suff[i] = pref[i] + 1;
        }
    }

    ll result = 0;

    for(int value, m, n = 1;(value = binpow(n, c - 1)) < MAX_VAL;n++) {
        for(int b0 = value;b0 < MAX_VAL;b0 += n) {
            if(b0 < l || b0 == 1) continue;
            if(b0 > r) break;
            m = pref[int(ll(r) * ll(value) / ll(b0))];
            for(int tmp_m = n + 1;tmp_m <= m;tmp_m++) {
                result += __gcd(tmp_m, n) == 1;
//                if(__gcd(tmp_m, n) == 1) {
//                    cout << b0 << " " << tmp_m << "/" << n << "\n";
//                }
            }
            m = suff[int(ll( 1ll * l * value + b0 - 1 ) / ll(b0))];
            for(int tmp_m = m;tmp_m < n;tmp_m++) {
                result += __gcd(tmp_m, n) == 1;
//                if(__gcd(tmp_m, n) == 1) {
//                    cout << b0 << " " << tmp_m << "/" << n << "\n";
//                }
            }
        }
    }

    cout << result << "\n";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef long double ld;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

ll binpow(ll n, ll p) {
    if(p == 0) return 1ll;
    ll q = binpow(n, p / 2);
    q = min(ll(inf), 1ll * q * q);
    if(p % 2) q = min(ll(inf), 1ll * q * n);
    return q;
}

int const MAX_VAL = 10 * 1000 * 1000 + 5;

ll pref[MAX_VAL];
ll suff[MAX_VAL];

ll gcd(ll x, ll y) {
    return !x ? y : gcd(y % x, x);
}

int main() {

    ll c, l, r;

    cin >> c >> l >> r;

    if(c == 1) {
        cout << r - l + 1 << "\n";
        return 0;
    }

    if(c == 2) {
        ll len = r - l + 1;
        cout << len * (len - 1) << "\n";
        return 0;
    }

    // pref[i] -> max x ^ (c - 1) <= i
    // suff[i] -> min x ^ (c - 1) >= i

    pref[0] = 0ll;
    pref[1] = 1ll;

    for(ll x = 2;x < MAX_VAL;x++) {
        pref[x] = pref[x - 1];
        while(binpow(pref[x] + 1, c - 1) <= x) {
            pref[x]++;
        }
    }

    for(int i = 0;i < MAX_VAL;i++) {
        suff[i] = pref[i];
        while(binpow(suff[i], c - 1) < i) suff[i]++;
    }

    ll result = 0;

    for(ll value, m, n = 1;(value = binpow(n, c - 1)) < MAX_VAL;n++) {
        for(ll b0 = value;b0 < MAX_VAL;b0 += value) {
            if(b0 < l || b0 == 1) continue;
            if(b0 > r) break;
            m = pref[int(ll(r) * ll(value) / ll(b0))];
            for(ll tmp_m = n + 1;tmp_m <= m;tmp_m++) {
                result += gcd(tmp_m, n) == 1;
            }
            m = suff[int(ll( 1ll * l * value + b0 - 1 ) / ll(b0))];
            for(ll tmp_m = m;tmp_m < n;tmp_m++) {
                result += gcd(tmp_m, n) == 1;
            }
        }
    }

    cout << result << "\n";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef long double ld;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

ll binpow(ll n, ll p) {
    if(p == 0) return 1ll;
    ll q = binpow(n, p / 2);
    q = min(ll(inf), 1ll * q * q);
    if(p % 2) q = min(ll(inf), 1ll * q * n);
    return q;
}

int const MAX_VAL = 10 * 1000 * 1000 + 5;

ll pref[MAX_VAL];

ll gcd(ll x, ll y) {
    return !x ? y : gcd(y % x, x);
}

int is_sqrt[MAX_VAL];

int main() {

    ll c, l, r;

    cin >> c >> l >> r;

    if(c == 1) {
        cout << r - l + 1 << "\n";
        return 0;
    }

    if(c == 2) {
        ll len = r - l + 1;
        cout << len * (len - 1) << "\n";
        return 0;
    }

    if(c == 3) {
        for(int i = 1;i * i < MAX_VAL;i++) is_sqrt[i * i] = i;
        ll result = 0;
        for(int z = l;z <= r;z++) {
            int delt = is_sqrt[z] * is_sqrt[z] != z ? z : is_sqrt[z];
            for(int x = delt;x < MAX_VAL;x += delt) {
                if(z < x) {
                    ll y = 1ll * x * x / z;
                    if(l <= z && z < x && x < y && y <= r) {
                        result++;
                    }
                }
            }
        }
        cout << 2 * result << "\n";
        return 0;
    }

    // pref[i] -> max x ^ (c - 1) <= i
    // suff[i] -> min x ^ (c - 1) >= i

    pref[0] = 0ll;
    pref[1] = 1ll;

    for(ll x = 2;x < MAX_VAL;x++) {
        pref[x] = pref[x - 1];
        while(binpow(pref[x] + 1, c - 1) <= x) {
            pref[x]++;
        }
    }

    ll result = 0;

    for(ll value, m, n = 1;(value = binpow(n, c - 1)) < MAX_VAL;n++) {
        for(ll b0 = value;b0 < MAX_VAL;b0 += n) {
            if(b0 % value) continue;
            if(b0 < l) continue;
            if(b0 > r) break;
            m = pref[int(ll(r) * ll(value) / ll(b0))];
            for(ll tmp_m = n + 1;tmp_m <= m;tmp_m++) {
                result += gcd(tmp_m, n) == 1;
            }
        }
    }

    cout << 2ll * result << "\n";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef long double ld;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

ll binpow(ll n, ll p) {
    if(p == 0) return 1ll;
    ll q = binpow(n, p / 2);
    q = min(ll(inf), 1ll * q * q);
    if(p % 2) q = min(ll(inf), 1ll * q * n);
    return q;
}

int const MAX_VAL = 10 * 1000 * 1000 + 5;

ll pref[MAX_VAL];

ll gcd(ll x, ll y) {
    return !x ? y : gcd(y % x, x);
}

int is_sqrt[MAX_VAL];

int main() {

    ll c, l, r;

    cin >> c >> l >> r;

    if(c == 1) {
        cout << r - l + 1 << "\n";
        return 0;
    }

    if(c == 2) {
        ll len = r - l + 1;
        cout << len * (len - 1) << "\n";
        return 0;
    }

    if(0 && c == 3) {
        for(int i = 1;i * i < MAX_VAL;i++) is_sqrt[i * i] = i;
        ll result = 0;
        for(int z = l;z <= r;z++) {
            int delt = is_sqrt[z] * is_sqrt[z] != z ? z : is_sqrt[z];
            for(int x = delt;x < MAX_VAL;x += delt) {
                if(z < x && x * x % z == 0) {
                    ll y = 1ll * x * x / z;
                    if(l <= z && z < x && x < y && y <= r) {
                        result++;
                    }
                }
            }
        }
        cout << 2 * result << "\n";
        return 0;
    }

    // pref[i] -> max x ^ (c - 1) <= i
    // suff[i] -> min x ^ (c - 1) >= i

    pref[0] = 0ll;
    pref[1] = 1ll;

    for(ll x = 2;x < MAX_VAL;x++) {
        pref[x] = pref[x - 1];
        while(binpow(pref[x] + 1, c - 1) <= x) {
            pref[x]++;
        }
    }

    ll result = 0;

    for(ll value, m, n = 1;(value = binpow(n, c - 1)) < MAX_VAL;n++) {
        for(ll b0 = value;b0 < MAX_VAL;b0 += value) {
            if(b0 < l) continue;
            if(b0 > r) break;
            m = pref[int(ll(r) * ll(value) / ll(b0))];
            for(ll tmp_m = n + 1;tmp_m <= m;tmp_m++) {
                result += gcd(tmp_m, n) == 1;
            }
        }
    }

    cout << 2ll * result << "\n";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef long double ld;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

ll binpow(ll n, ll p) {
    if(p == 0) return 1ll;
    ll q = binpow(n, p / 2);
    q = min(ll(inf), 1ll * q * q);
    if(p % 2) q = min(ll(inf), 1ll * q * n);
    return q;
}

int const MAX_VAL = 10 * 1000 * 1000 + 5;

ll pref[MAX_VAL];

ll gcd(ll x, ll y) {
    return !x ? y : gcd(y % x, x);
}

int main() {

    ll c, l, r;

    cin >> c >> l >> r;

    if(c == 1) {
        cout << r - l + 1 << "\n";
        return 0;
    }

    if(c == 2) {
        ll len = r - l + 1;
        cout << len * (len - 1) << "\n";
        return 0;
    }

    // pref[i] -> max x ^ (c - 1) <= i
    // suff[i] -> min x ^ (c - 1) >= i

    pref[0] = 0ll;
    pref[1] = 1ll;

    for(ll x = 2;x < MAX_VAL;x++) {
        pref[x] = pref[x - 1];
        while(binpow(pref[x] + 1, c - 1) <= x) {
            pref[x]++;
        }
    }

    ll result = 0;

    for(ll value, m, n = 1;(value = binpow(n, c - 1)) < MAX_VAL;n++) {
        for(ll b0 = value;b0 < MAX_VAL;b0 += n) {
            if(b0 % value) continue;
            if(b0 < l) continue;
            if(b0 > r) break;
            m = pref[int(ll(r) * ll(value) / ll(b0))];
            for(ll tmp_m = n + 1;tmp_m <= m;tmp_m++) {
                result += gcd(tmp_m, n) == 1;
            }
        }
    }

    cout << 2ll * result << "\n";

    return 0;
}


#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
#define ll long long
ll n,l,r;
ll power(ll x,ll idx){
	if(idx==1)return x;
	if(idx==0)return 1ll;
    ll p=power(x,idx/2);
    if(idx%2)return p*p*x;
    else return p*p;
}
void solve(){
	ll ans=0,l_,r_;
    for(ll p=2;p<r;p++){
        r_=r/power(p,n-1);
        if(r_==0)break;
        for(ll q=1;q<p;q++){
            l_=(l-1)/power(q,n-1)+1;
            if(l_>r_)continue;
            if(__gcd(p,q)==1)ans+=(r_-l_+1);
        }
    }
    printf("%lld\n",ans*2);
}
int main(){
	scanf("%lld%lld%lld",&n,&l,&r);
	switch(n){
		case 1:printf("%lld\n",r-l+1);return 0;
		case 2:printf("%lld\n",(r-l+1)*(r-l));return 0;
		default:(n>40)?(puts("0"),exit(0)):(solve());return 0;
	}
}


#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
#define ll long long
ll n,l,r;
ll power(ll x,ll idx){
	if(idx==1)return x;
	if(idx==0)return 1ll;
    ll p=power(x,idx/2);
    if(idx%2)return p*p*x;
    else return p*p;
}
void solve(){
	ll ans=0,l_,r_;
    for(int p=2;p<r;p++){
        r_=r/power(p,n-1);
        if(r_==0)break;
        for(int q=1;q<p;q++){
            l_=(l-1)/power(q,n-1)+1;
            if(l_>r_) continue;
            if(__gcd(p,q)==1)ans+=(r_-l_+1);
        }
    }
    printf("%d\n",ans*2);
}
int main(){
	scanf("%lld%lld%lld",&n,&l,&r);
	switch(n){
		case 1:printf("%d\n",r-l+1);return 0;
		case 2:printf("%d\n",(r-l+1)*(r-l));return 0;
		default:(n>40)?(puts("0"),exit(0)):(solve());return 0;
	}
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<iostream>
#include<stack>
#include<set>
#include<string>
#include<map>
#include<bitset>
using namespace std;
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define mst(x,a) memset(x,a,sizeof(x))
#define all(x) (x).begin(),(x).end()
#define CLOSE ios::sync_with_stdio(false)
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
#define fi first
#define se second
#define sz(x) ((int)x.size())
#define cl(x) x.clear()
const int N = 200100;
const int M = 1000100;
const int INF=0x3f3f3f3f;
const int mod=1000000007;
void MOD(ll &a){if(a>=mod) a-=mod;}
void MOD(ll &a,ll c){if(a>=c) a-=c;}
void ADD(ll &a,ll b){ a+=b; MOD(a);}
void ADD(ll &a,ll b,ll c){a+=b;MOD(a,c);}
ll qpow(ll a,ll b){ll ans=1;while(b){if(b&1)ans=ans*a;a=a*a;b/=2;}return ans;}
ll qpow(ll a,ll b,ll c){ll ans=1;while(b){if(b&1)ans=ans*a%c;a=a*a%c;b/=2;}return ans;}

ll n,l,r;

int main(){
    scanf("%lld%lld%lld",&n,&l,&r);
    if(n==1){
        printf("%lld\n",r-l+1);
        return 0;
    }
    if(n==2){
        printf("%lld\n",(r-l+1)*(r-l));
        return 0;
    }
    if(n>24){
        printf("0\n");
        return 0;
    }
    int x=pow(r,1.0/(n-1))+1;
    ll ans=0,qn,pn;
    for(int i=1;i<=x;i++){
        for(int j=i+1;j<=x;j++){
            if(__gcd(i,j)==1){
                qn=qpow(j,n-1);
                pn=qpow(i,n-1);
                if(l*qn/pn>r) continue;
                ans+=(r*pn/qn)/pn-(l-1)/pn;

            }

        }
    }
    printf("%lld\n",ans*2);
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<iostream>
#include<stack>
#include<set>
#include<string>
#include<map>
#include<bitset>
using namespace std;
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define mst(x,a) memset(x,a,sizeof(x))
#define all(x) (x).begin(),(x).end()
#define CLOSE ios::sync_with_stdio(false)
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
#define fi first
#define se second
#define sz(x) ((int)x.size())
#define cl(x) x.clear()
const int N = 200100;
const int M = 1000100;
const int INF=0x3f3f3f3f;
const int mod=1000000007;
void MOD(ll &a){if(a>=mod) a-=mod;}
void MOD(ll &a,ll c){if(a>=c) a-=c;}
void ADD(ll &a,ll b){ a+=b; MOD(a);}
void ADD(ll &a,ll b,ll c){a+=b;MOD(a,c);}
ll qpow(ll a,ll b){ll ans=1;while(b){if(b&1)ans=ans*a;a=a*a;b/=2;}return ans;}
ll qpow(ll a,ll b,ll c){ll ans=1;while(b){if(b&1)ans=ans*a%c;a=a*a%c;b/=2;}return ans;}

ll n,l,r;

int main(){
    scanf("%lld%lld%lld",&n,&l,&r);
    if(n==1){
        printf("%lld\n",r-l+1);
        return 0;
    }
    if(n==2){
        printf("%lld\n",(r-l+1)*(r-l));
        return 0;
    }
    if(n>=24){
        printf("0\n");
        return 0;
    }
    int x=pow(2,double(log2(r)/(n-1)))+1;
    ll ans=0,qn,pn;
    for(int i=1;i<=x;i++){
        for(int j=i+1;j<=x;j++){
            if(__gcd(i,j)==1){
                qn=qpow(j,n-1);
                pn=qpow(i,n-1);
                if(l*qn/pn>r) continue;
                ans+=(r*pn/qn)/pn-(l-1)/pn;

            }

        }
    }
    printf("%lld\n",ans*2);
}
/*
*/


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<iostream>
#include<stack>
#include<set>
#include<string>
#include<map>
#include<bitset>
using namespace std;
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define mst(x,a) memset(x,a,sizeof(x))
#define all(x) (x).begin(),(x).end()
#define CLOSE ios::sync_with_stdio(false)
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
#define fi first
#define se second
#define sz(x) ((int)x.size())
#define cl(x) x.clear()
const int N = 200100;
const int M = 1000100;
const int INF=0x3f3f3f3f;
const int mod=1000000007;
void MOD(ll &a){if(a>=mod) a-=mod;}
void MOD(ll &a,ll c){if(a>=c) a-=c;}
void ADD(ll &a,ll b){ a+=b; MOD(a);}
void ADD(ll &a,ll b,ll c){a+=b;MOD(a,c);}
ll qpow(ll a,ll b){ll ans=1;while(b){if(b&1)ans=ans*a;a=a*a;b/=2;}return ans;}
ll qpow(ll a,ll b,ll c){ll ans=1;while(b){if(b&1)ans=ans*a%c;a=a*a%c;b/=2;}return ans;}

ll n,l,r;

int main(){
    scanf("%lld%lld%lld",&n,&l,&r);
    if(n==1){
        printf("%lld\n",r-l+1);
        return 0;
    }
    if(n==2){
        printf("%lld\n",(r-l+1)*(r-l));
        return 0;
    }
    if(n>24){
        printf("0\n");
        return 0;
    }
    int x=pow(r,1.0/(n-1));
    ll ans=0,qn,pn;
    for(int i=1;i<=x;i++){
        for(int j=i+1;j<=x;j++){
            if(__gcd(i,j)==1){
                qn=qpow(j,n-1);
                pn=qpow(i,n-1);
                if(l*qn/pn>r) continue;
                ans+=(r*pn/qn)/pn-(l-1)/pn;

            }

        }
    }
    printf("%lld\n",ans*2);
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<iostream>
#include<stack>
#include<set>
#include<string>
#include<map>
#include<bitset>
using namespace std;
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define mst(x,a) memset(x,a,sizeof(x))
#define all(x) (x).begin(),(x).end()
#define CLOSE ios::sync_with_stdio(false)
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
#define fi first
#define se second
#define sz(x) ((int)x.size())
#define cl(x) x.clear()
const int N = 200100;
const int M = 1000100;
const int INF=0x3f3f3f3f;
const int mod=1000000007;
void MOD(ll &a){if(a>=mod) a-=mod;}
void MOD(ll &a,ll c){if(a>=c) a-=c;}
void ADD(ll &a,ll b){ a+=b; MOD(a);}
void ADD(ll &a,ll b,ll c){a+=b;MOD(a,c);}
ll qpow(ll a,ll b){ll ans=1;while(b){if(b&1)ans=ans*a;a=a*a;b/=2;}return ans;}
ll qpow(ll a,ll b,ll c){ll ans=1;while(b){if(b&1)ans=ans*a%c;a=a*a%c;b/=2;}return ans;}

ll n,l,r;

int main(){
    scanf("%lld%lld%lld",&n,&l,&r);
    if(n==1){
        printf("%lld\n",r-l+1);
        return 0;
    }
    if(n==2){
        printf("%lld\n",(r-l+1)*(r-l));
        return 0;
    }
    if(n>24){
        printf("0\n");
        return 0;
    }
    int x=pow(2,double(log2(r)/(n-1)))+1;
    ll ans=0,qn,pn;
    for(int i=1;i<=x;i++){
        for(int j=i+1;j<=x;j++){
            if(__gcd(i,j)==1){
                qn=qpow(j,n-1);
                pn=qpow(i,n-1);
                if(l*qn/pn>r) continue;
                ans+=(r*pn/qn)/pn-(l-1)/pn;

            }

        }
    }
    printf("%lld\n",ans*2);
}


#include <bits/stdc++.h>
#define LL long long

using namespace std;

LL gcd(LL a, LL b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}

LL QuickPow(LL a, LL n)
{
	LL ret=1;
	while(n)
	{
		if(n&1) ret*=a;
		a*=a;
		n>>=1;
	}
	return ret;
}

LL l,r,n;
LL upperlimit,pn,qn;
LL ans;

int main()
{
	cin>>n>>l>>r;
	if(n>24)
	{
		cout<<0;
		return 0;
	}
	if(n==1)
	{
		cout<<r-l+1;
		return 0;
	}
	if(n==2)
	{
		cout<<(r-l+1)*(r-l);
		return 0;
	}
	upperlimit=pow(2,log2(1e7)/(n-1));
    //upperlimit=min(upperlimit,3100LL);
		for(LL p=1;p<=upperlimit;p++)
			for(LL q=p+1;q<=upperlimit;q++)
				if(gcd(p,q)==1)
				{
					qn=QuickPow(q,n-1);
					pn=QuickPow(p,n-1);
					if(l*qn/pn>r) continue;
					ans+=(r*pn/qn)/pn-(l-1)/qn;
				}
		cout<<ans*2;
		return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;

LL gcd(LL a, LL b){
    if(b==0) return a;
    else return gcd(b,a%b);
}

LL QuickPow(LL a, LL n){
	LL ret=1;
	while(n){
		if(n&1) ret*=a;
		a*=a;
		n>>=1;
	}
	return ret;
}

LL l,r,n;
LL ans;

int main()
{
	cin>>n>>l>>r;
	if(n>24){
		cout<<0;return 0;
	}
	if(n==1){
		cout<<r-l+1;return 0;
	}
	if(n==2){
		cout<<(r-l+1)*(r-l);return 0;
	}

	//n>=3&&n<24的情况
    LL upperlimit,pn,qn;
	//p,q的枚举上界
	upperlimit=pow(2,double(log2(1e7+50)/(n-1)));

    for(LL p=1;p<=upperlimit;p++)
        for(LL q=p+1;q<=upperlimit;q++)
            if(gcd(p,q)==1)
            {
                qn=QuickPow(q,n-1);
                pn=QuickPow(p,n-1);
                if(l*qn/pn>r) continue;

                //a1可能的值 :[l,r*pn/qn]范围内可被 pn整除的正整数,
                ans+=(r*pn/qn)/pn-(l-1)/pn;
            }
       //递增数列递减数列成对出现，只考虑了递增数列
		cout<<ans*2;
		return 0;
}


#include <bits/stdc++.h>
#define LL long long

using namespace std;

LL gcd(LL a, LL b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}

LL QuickPow(LL a, LL n)
{
	LL ret=1;
	while(n)
	{
		if(n&1) ret*=a;
		a*=a;
		n>>=1;
	}
	return ret;
}

LL l,r,n;
LL upperlimit,pn,qn;
LL ans;

int main()
{
	cin>>n>>l>>r;
	if(n>24)
	{
		cout<<0;
		return 0;
	}
	if(n==1)
	{
		cout<<r-l+1;
		return 0;
	}
	if(n==2)
	{
		cout<<(r-l+1)*(r-l);
		return 0;
	}

	//n>=3&&n<24的情况

	//枚举p,q的上界
	upperlimit=pow(2,double(log2(1e7)/(n-1)));

    //upperlimit=min(upperlimit,3100LL);
		for(LL p=1;p<=upperlimit;p++)
			for(LL q=p+1;q<=upperlimit;q++)
				if(gcd(p,q)==1)
				{
					qn=QuickPow(q,n-1);
					pn=QuickPow(p,n-1);
					if(l*qn/pn>r) continue;
					ans+=(r*pn/qn)/pn-(l-1)/pn;
				}
        //递增数列递减数列成对出现，只考虑了递增数列
		cout<<ans*2;
		return 0;
}


#include <bits/stdc++.h>

#define vi vector <int>
#define vvi vector < vi >
#define pii pair <int, int>
#define pb push_back

using namespace std;
typedef long long ll;

ll pw(ll v, ll u, ll mx) {
	// cout << v <<  " " << u << " " << mx << endl;
	if (v == 1 || u == 0) return 1;
	ll res = pw(v, u / 2, mx);
	if (res == -1) return res;
	res = res * res;
	if (res > mx) return -1;
	if (u % 2) res *= v;
	if (res > mx) return -1;
	return res;
}

bool flag[10000001];

ll gcd(ll v, ll u) {
	if (v > u) return gcd(u, v);
	if (v == 0) return u;
	return gcd(u % v, v);
}

void testcase() {
	ll n, l, r;
	cin >> n >> l >> r;
	if (n == 1) {
		cout << r - l + 1 << endl;
		return;
	}
	if (n == 2) {
		cout << (r - l + 1) * (r - l ) << endl;
		return;
	}
	n --;
	// cout << "test "<< endl;
	ll ans = 0;
	ll x = 1, y = 1;

	while (true) {
		x ++;
		ll xn = pw(x, n, r);
		// cout << "x & pw(x, n) " << x << " " << xn << endl;
		if (xn == -1) break;
		for (int y = 1; y < x; y++) {
			if (gcd(x, y) != 1) continue;

			ll yn = pw(y, n, r);
			// if (yn < l) continue;
			// cout << "y & pw(y, n) " << y << " " << yn << endl;

			ll xtMin = l / xn + (l % xn != 0);
			ll xtMax = r / xn;
			ll ytMin = l / yn + (l % yn != 0);
			ll ytMax = r / yn;
			ll tMin = max(xtMin, ytMin);
			ll tMax = min(xtMax, ytMax);
			if (tMax >= tMin) {
				ans += tMax - tMin + 1;
				// cout << "ans " << ans << endl;
			}
		}
	}
	cout << 2 * ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	testcase();
	return 0;
}


#include <bits/stdc++.h>

#define vi vector <int>
#define vvi vector < vi >
#define pii pair <int, int>
#define pb push_back

using namespace std;
typedef long long ll;

ll pw(ll v, ll u, ll mx) {
	// cout << v <<  " " << u << " " << mx << endl;
	if (v == 1 || u == 0) return 1;
	ll res = pw(v, u / 2, mx);
	if (res == -1) return res;
	res = res * res;
	if (res > mx) return -1;
	if (u % 2) res *= v;
	if (res > mx) return -1;
	return res;
}

bool flag[10000001];

void testcase() {
	ll n, l, r;
	cin >> n >> l >> r;
	if (n == 1) {
		cout << r - l + 1 << endl;
		return;
	}
	if (n == 2) {
		cout << (r - l + 1) * (r - l ) << endl;
		return;
	}
	n --;
	// cout << "test "<< endl;
	ll ans = 0;
	ll x = 1, y = 1;

	while (true) {
		x ++;
		ll xn = pw(x, n, r);
		// cout << "x & pw(x, n) " << x << " " << xn << endl;
		if (xn == -1) break;
		for (int y = 1; y < x; y++) {
			if (x % y == 0) {
				if (flag[x % y]) continue;
				flag[x % y] = true;
			}

			ll yn = pw(y, n, r);
			// if (yn < l) continue;
			// cout << "y & pw(y, n) " << y << " " << yn << endl;

			ll xtMin = l / xn + (l % xn != 0);
			ll xtMax = r / xn;
			ll ytMin = l / yn + (l % yn != 0);
			ll ytMax = r / yn;
			ll tMin = max(xtMin, ytMin);
			ll tMax = min(xtMax, ytMax);
			if (tMax >= tMin) {
				ans += tMax - tMin + 1;
				// cout << "ans " << ans << endl;
			}
		}
	}
	cout << 2 * ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	testcase();
	return 0;
}


#include <bits/stdc++.h>

#define vi vector <int>
#define vvi vector < vi >
#define pii pair <int, int>
#define pb push_back

using namespace std;
typedef long long ll;

ll pw(ll v, ll u, ll mx) {
	// cout << v <<  " " << u << " " << mx << endl;
	if (v == 1 || u == 0) return 1;
	ll res = pw(v, u / 2, mx);
	if (res == -1) return res;
	res = res * res;
	if (res > mx) return -1;
	if (u % 2) res *= v;
	if (res > mx) return -1;
	return res;
}

bool flag[10000001];

void testcase() {
	ll n, l, r;
	cin >> n >> l >> r;
	if (n == 1) {
		cout << r - l + 1 << endl;
		return;
	}
	if (n == 2) {
		cout << (r - l + 1) * (r - l ) << endl;
		return;
	}
	n --;
	// cout << "test "<< endl;
	ll ans = 0;
	ll x = 1, y = 1;

	while (true) {
		x ++;
		ll xn = pw(x, n, r);
		// cout << "x & pw(x, n) " << x << " " << xn << endl;
		if (xn == -1) break;
		for (int y = 1; y < x; y++) {
			if (x % y == 0) {
				if (flag[x / y]) continue;
				flag[x / y] = true;
			}

			ll yn = pw(y, n, r);
			// if (yn < l) continue;
			// cout << "y & pw(y, n) " << y << " " << yn << endl;

			ll xtMin = l / xn + (l % xn != 0);
			ll xtMax = r / xn;
			ll ytMin = l / yn + (l % yn != 0);
			ll ytMax = r / yn;
			ll tMin = max(xtMin, ytMin);
			ll tMax = min(xtMax, ytMax);
			if (tMax >= tMin) {
				ans += tMax - tMin + 1;
				// cout << "ans " << ans << endl;
			}
		}
	}
	cout << 2 * ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	testcase();
	return 0;
}


#include <bits/stdc++.h>

#define vi vector <int>
#define vvi vector < vi >
#define pii pair <int, int>
#define pb push_back

using namespace std;
typedef long long ll;

ll pw(ll v, ll u, ll mx) {
	// cout << v <<  " " << u << " " << mx << endl;
	if (v == 1 || u == 0) return 1;
	ll res = pw(v, u / 2, mx);
	if (res == -1) return res;
	res = res * res;
	if (res > mx) return -1;
	if (u % 2) res *= v;
	if (res > mx) return -1;
	return res;
}

void testcase() {
	ll n, l, r;
	cin >> n >> l >> r;
	if (n == 1) {
		cout << r - l + 1 << endl;
		return;
	}
	if (n == 2) {
		cout << (r - l + 1) * (r - l ) << endl;
		return;
	}
	n --;
	// cout << "test "<< endl;
	ll ans = 0;
	ll x = 1, y = 1;
	while (true) {
		x ++;
		ll xn = pw(x, n, r);
		// cout << "x & pw(x, n) " << x << " " << xn << endl;
		if (xn == -1) break;
		for (int y = 1; y < x; y++) {
			ll yn = pw(y, n, r);
			// if (yn < l) continue;
			// cout << "y & pw(y, n) " << y << " " << yn << endl;

			ll xtMin = l / xn + (l % xn != 0);
			ll xtMax = r / xn;
			ll ytMin = l / yn + (l % yn != 0);
			ll ytMax = r / yn;
			ll tMin = max(xtMin, ytMin);
			ll tMax = min(xtMax, ytMax);
			if (tMax >= tMin) {
				ans += tMax - tMin + 1;
				//cout << "ans " << ans << endl;
			}
		}
	}
	cout << 2 * ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	testcase();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll INF = 9E18 + 10;

ll ans, n, l, r;

ll pow(ll u, ll v) {
  ll res = 1;
  while(v) {
    if(v & 1) res = res * u;
    if(INF / u <= u) return INF;
    u *= u;
    v >>= 1;
  }
  return res;
}

int main() {
  cin >> n >> l >> r;
  if(n == 1) cout << r - l + 1 << endl;
  else if(n == 2) cout << (r - l + 1) * (r - l) << endl;
  else {
    int b = (int)sqrt(1.0 * n) + 10;
    for(int i = 1; i <= b; i++) {
      for(int j = i + 1; j <= b; j++){
        if(__gcd(i, j) == 1) {
          ll u = pow(i, n - 1), v = pow(j, n - 1);
          ll b1 = (ll)floor(1.0 * r / v), b2 = (ll)ceil(1.0 * l / (u));
          if(b2 > b1 || v > r || u > r) continue;
          ans += b1 - b2 + 1;
        }
      }
    }
    cout << ans * 2 << endl;
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define debug0(x) printf("! %d\n", x);
#define debug1(x, a, b) for(int (ii)=(a);(ii)<(b);(ii++)) printf("%d: %d\n", ii, x[ii]);
#define nono(x, ite) for(__typeof((x).begin()) (ite)=(x).begin();(ite)!=(x).end();(ite++))

typedef long long ll;

const int N = 1e7 + 10;
const int LEN = 26;

int f[N][LEN];
int n;

int main() {
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define debug0(x) printf("! %d\n", x);
#define debug1(x, a, b) for(int (ii)=(a);(ii)<(b);(ii++)) printf("%d: %d\n", ii, x[ii]);
#define nono(x, ite) for(__typeof((x).begin()) (ite)=(x).begin();(ite)!=(x).end();(ite++))

typedef long long ll;

const int N = 1e7 + 1;
const int LEN = 26;

int f[N][LEN];
int n;

int main() {
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 9E18 + 10;

ll ans, n, l, r;

ll pow(ll u, ll v) {
  ll res = 1;
  while(v) {
    if(v & 1) res = res * u;
    if(INF / u <= u) return INF;
    u *= u;
    v >>= 1;
  }
  return res;
}

int main() {
  cin >> n >> l >> r;
  if(n == 1) cout << r - l + 1 << endl;
  else if(n == 2) cout << (r - l + 1) * (r - l) << endl;
  else {
    ll b = (ll)sqrt(1.0 * n) + 10;
    for(ll i = 1; i <= b; i++) {
      for(ll j = i + 1; j <= b; j++){
        if(__gcd(i, j) == 1) {
          ll u = pow(i, n - 1), v = pow(j, n - 1);
          ll b1 = (ll)floor(1.0 * r / v), b2 = (ll)ceil(1.0 * l / u);
          if(b2 > b1 || v > r || u > r) continue;
          ans += b1 - b2 + 1;
        }
      }
    }
    cout << ans * 2 << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const ll INF = 9E18 + 10;

ll ans, n, l, r;

ll pow(ll u, ll v) {
  ll res = 1;
  while(v) {
    if(v & 1) res = res * u;
    if(INF / u <= u) return INF;
    u *= u;
    v >>= 1;
  }
  return res;
}

int main() {
  cin >> n >> l >> r;
  if(n > 25) cout << 0 << endl;
  else if(n == 1) cout << r - l + 1 << endl;
  else if(n == 2) cout << (r - l + 1) * (r - l) << endl;
  else {
    int b = (int)sqrt(1.0 * n) + 10;
    for(int i = 1; i <= b; i++) {
      for(int j = i + 1; j <= b; j++){
        if(__gcd(i, j) == 1) {
          ll u = pow(i, n - 1), v = pow(j, n - 1);
          ll b1 = (ll)floor(r / v), b2 = (ll)ceil(l / (u));
          if(b2 > b1 || v > r || u > r) continue;
          ans += b1 - b2 + 1;
        }
      }
    }
    cout << ans * 2 << endl;
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 9E18 + 10;

ll ans, n, l, r;

ll pow(ll u, ll v) {
  ll res = 1;
  while (v) {
    if (v & 1) res = res * u;
    if (INF / u <= u) return INF;
    u *= u;
    v >>= 1;
  }
  return res;
}

int main() {
  cin >> n >> l >> r;
  if (n == 1) cout << r - l + 1 << endl;
  else if (n == 2) cout << (r - l + 1) * (r - l) << endl;
  else {
    ll b = (ll)sqrt(1.0 * r) + 10;
    for (ll i = 1; i <= b; i++) {
      for (ll j = i + 1; j <= b; j++) {
        if (__gcd(i, j) == 1) {
          ll u = pow(i, n - 1), v = pow(j, n - 1);
          ll b1 = (ll)floor(1.0 * r / v), b2 = (ll)ceil(1.0 * l / u);
          if (b2 > b1 || v > r || u > r) continue;
          ans += b1 - b2 + 1;
        }
      }
    }
    cout << ans * 2 << endl;
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define rep(i, a, b) for (int i(a); i <= (b); ++i)

typedef long long LL;

LL n, l, r;
LL ans = 0;

LL power(LL x, LL n){
        LL ans = 1;
        rep(i, 1, n) ans *= x;
        return ans;
}

LL gcd(LL a, LL b){
        return b == 0 ? a : gcd(b, a % b);
}

int main(){

        scanf("%lld%lld%lld", &n, &l, &r);
	if (n == 1) return 0 * printf("%lld\n", (r - l + 1));
	if (n == 2) return 0 * printf("%lld\n", (r - l + 1) * (r - l));
	if (n > 25) return 0 * puts("0");
        rep(i, 2, r - 1){
                int p = i, R = r / power(p, n - 1);
                if (R == 0) break;
                rep(j, 1, p - 1){
                        int q = j;
                        int L = (l - 1) / power(q, n - 1) + 1;
                        if (L > R) continue;
                        if (gcd(p, q) == 1) { ans += (R - L + 1);}
                }
        }

        printf("%lld\n", ans * 2);
        return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define rep(i, a, b) for (int i(a); i <= (b); ++i)

typedef long long LL;

LL n, l, r;
LL ans = 0;

LL power(LL x, LL n){
        LL ans = 1;
        rep(i, 1, n) ans *= x;
        return ans;
}

LL gcd(LL a, LL b){
        return b == 0 ? a : gcd(b, a % b);
}

int main(){

        scanf("%lld%lld%lld", &n, &l, &r);
	if (n == 1) return 0 * printf("%lld\n", (r - l + 1));
	if (n == 2) return 0 * printf("%lld\n", (r - l + 1) * (r - l));
        rep(i, 2, r - 1){
                int p = i, R = r / power(p, n - 1);
                if (R == 0) break;
                rep(j, 1, p - 1){
                        int q = j;
                        int L = (l - 1) / power(q, n - 1) + 1;
                        if (L > R) continue;
                        if (gcd(p, q) == 1) { ans += (R - L + 1);}
                }
        }

        printf("%lld\n", ans * 2);
        return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define rep(i, a, b) for (int i(a); i <= (b); ++i)

typedef long long LL;

LL n, l, r;
LL ans = 0;

LL power(LL x, LL n){
        LL ans = 1;
        rep(i, 1, n) ans *= x;
        return ans;
}

LL gcd(LL a, LL b){
        return b == 0 ? a : gcd(b, a % b);
}

int main(){

        scanf("%lld%lld%lld", &n, &l, &r);
	if (n == 1) return 0 * printf("%lld\n", (r - l + 1));
	if (n == 2) return 0 * printf("%lld\n", (r - l + 1) * (r - l));
        rep(i, 2, r - 1){
                int p = i, R = r / power(p, n - 1);
                if (R == 0) break;
                rep(j, 1, p - 1){
                        int q = j;
                        int L = (l - 1) / power(q, n - 1) + 1;
                        if (L > R) continue;
                        if (gcd(p, q) == 1) { ans += (R - L + 1);}
                }
        }

        printf("%lld\n", ans);
        return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

inline ll Qpow(ll a, ll b, ll limit) {
    ll ret = 1;
    while (b) {
        if (b & 1) {
            if (1.0 * ret * a > limit) return limit + 1;
            ret = ret * a;
        }
        a = a * a;
        b >>= 1;
    }
    return ret;
}

int n, L, R;

int main() {
    scanf("%d%d%d", &n, &L, &R);

    int len = R - L + 1;

    if (n == 1) printf("%d\n", len);
    else if (n == 2) printf("%lld\n", 1ll * len * (len - 1));
    else if (n > 30) printf("0\n");
    else {
        ll ans = 0;
        for (int p = 1; ; ++p) {
            ll tp = Qpow(p, n - 1, R);
            if (tp > R) break;

            for (int q = p + 1; ; ++q) {
                if (__gcd(p, q) != 1) continue;
                ll tq = Qpow(q, n - 1, R);
                if (tq > R) break;

                ll maxv = R / tq, minv = (L + tp - 1) / tp;
                ans += max(0ll, maxv - minv + 1);
            }
        }
        printf("%lld\n", ans * 2);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

inline ll Qpow(ll a, ll b, ll limit) {
    ll ret = 1;
    while (b) {
        if (b & 1) {
            if (1.0 * ret * a > limit) return limit + 1;
            ret = ret * a;
        }
        a = a * a;
        b >>= 1;
    }
    return ret;
}

int n, L, R;

int main() {
    scanf("%d%d%d", &n, &L, &R);

    int len = R - L + 1;

    if (n == 1) printf("%d\n", len);
    else if (n == 2) printf("%lld\n", 1ll * len * (len - 1));
    else if (n > 30) printf("0\n");
    else {
        ll ans = 0;
        for (int p = 1; ; ++p) {
            ll tp = Qpow(p, n - 1, R);
            if (tp > R) break;

            for (int q = p + 1; ; ++q) {
                if (__gcd(p, q) != 1) continue;
                ll tq = Qpow(q, n - 1, R);
                if (tq > R) break;

         //       printf("p = %d q = %d tp = %lld tq = %lld\n", p, q, tp, tq);
                ll maxv = R / tq, minv = (L - 1) / tp;
                ans += max(0ll, maxv - minv);
            }
        }
        printf("%lld\n", ans * 2);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

inline ll Qpow(ll a, ll b, ll limit) {
    ll ret = 1;
    while (b) {
        if (b & 1) {
            if (1.0 * ret * a > limit) return limit + 1;
            ret = ret * a;
        }
        a = a * a;
        b >>= 1;
    }
    return ret;
}

int n, L, R;

int main() {
    scanf("%d%d%d", &n, &L, &R);

    int len = R - L + 1;

    if (n == 1) printf("%d\n", len);
    else if (n == 2) printf("%lld\n", 1ll * len * (len - 1));
    else if (n > 30) printf("0\n");
    else {
        ll ans = 0;
        for (int p = 1; ; ++p) {
            ll tp = Qpow(p, n - 1, R);
            if (tp > R) break;

            for (int q = p + 1; ; ++q) {
                if (__gcd(p, q) != 1) continue;
                ll tq = Qpow(q, n - 1, R);
                if (tq > R) break;

                ll maxv = R / tq, minv = (L - 1) / tp;

                assert(maxv >= minv);

                ans += max(0ll, maxv - minv);
            }
        }
        printf("%lld\n", ans * 2);
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

inline ll Qpow(ll a, ll b, ll limit) {
    ll ret = 1;
    while (b) {
        if (b & 1) {
            if (1.0 * ret * a > limit) return limit + 1;
            ret = ret * a;
        }
        a = a * a;
        b >>= 1;
    }
    return ret;
}

int n, L, R;

int main() {
    scanf("%d%d%d", &n, &L, &R);

    int len = R - L + 1;

    if (n == 1) printf("%d\n", len);
    else if (n == 2) printf("%lld\n", 1ll * len * (len - 1));
    else if (n > 30) printf("0\n");
    else {
        ll ans = 0;
        for (int p = 1; ; ++p) {
            ll tp = Qpow(p, n - 1, R);
            if (tp > R) break;

            for (int q = p + 1; ; ++q) {
                if (__gcd(p, q) != 1) continue;
                ll tq = Qpow(q, n - 1, R);
                if (tq > R) break;

                printf("p = %d q = %d tp = %lld tq = %lld\n", p, q, tp, tq);
                ll maxv = R / tq, minv = (L - 1) / tp;
                ans += max(0ll, maxv - minv);
            }
        }
        printf("%lld\n", ans * 2);
    }

    return 0;
}


#include <bits/stdc++.h>
#define int long long
using namespace std;

const double eps = 1e-10;
const int N = 1e7+10;

int n, l, r;
int f[N], s[N];
vector<int> v;

signed main() {
	scanf("%lld%lld%lld", &n, &l, &r);
	if (n == 1) {
		printf("%lld\n", r-l+1);
	} else if (n == 2) {
		printf("%lld\n", 1ll*(r-l+1)*(r-l));
	} else {
		--n;
		int ans = 0;
		for (int i = 1; i <= r; ++i) {
			int ret = 1;
			for (int j = 0; j < n; ++j) {
				if (r/i < ret) { ret = r+1; break; }
				ret *= i;
			}
			if (ret > r) break;
			v.push_back(ret);
			s[ret] = 1;
			//printf("%lld %lld\n", i, ret);
		}
		for (int i = 1; i <= r; ++i) {
			s[i] += s[i-1];
			//printf("s[%lld] = %lld\n", i, s[i]);
		}
		for (int i = r; i >= 1; --i) {
			int L = (l+i-1)/i, R = (r/i);
			int x = s[R]-s[L-1];
			//printf("%lld %lld\n", i, x);
			f[i] = 1ll*x*(x-1);
			for (int j = 1; j < (int)v.size() && i*v[j] <= r; ++j) {
				f[i] -= f[i*v[j]];
			}
			ans += f[i];
		}
		printf("%lld\n", ans);
	}
}


//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

using namespace std;

#define int long long

int const mod = 1e9+7, MX = 3333, N = 60+3, maxR = 1e7+20, inf = 1e9+10;
int n, l, r, ans, pw[MX][N], d[maxR], y[maxR], t[maxR];
bool nprime[MX];

int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> l >> r;
	if (n == 1) return cout << r-l+1 << '\n', 0;
	if (n == 2) return cout << (r-l+1) * 1ll * (r-l) % mod << '\n', 0;
	if (n >= 60) return cout << "0\n", 0;

	for (int i = 1; i < MX; i ++)
		for (int j = pw[i][0] = 1; j < N; j ++) pw[i][j] = min(pw[i][j-1] * 1ll * i, inf * 1ll);

	for (int i = 0; i < maxR; i ++) y[i] = i, t[i] = 1;

	n--;

	for (int i = 2; i < MX; i ++){
		if (nprime[i]) continue;
		d[i] = 1;
		for (int j = 2*i; j < maxR; j ++){
			if (j < MX) nprime[j] = 1;
			if (j % (i*i)) d[j] = 1;
			else {
				d[j] = d[j/i] + 1;
				int x = d[j] / n;
				y[j] /= pw[i][x*n];
				t[j] *= pw[i][x];
			}
		}
	}

	for (int i = l; i <= r; i ++){
		if (y[i] * 1ll * pw[t[i]+1][n] > r) continue;
		int L = t[i]+1, R = MX;
		while (L < R-1){
		  	int mid = (L+R)>>1;
			if (y[i] * 1ll * pw[mid][n] <= r) L = mid;
			else R = mid;
		}
		(ans += 2 * (L - t[i])) %= mod;
	}

	cout << ans << '\n';
}


//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

using namespace std;

#define int long long

int const MX = 3333, N = 60+3, maxR = 1e7+20, inf = 1e9+10;
int n, l, r, ans, pw[MX][N], d[maxR], y[maxR], t[maxR];
bool nprime[MX];

int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> l >> r;
	if (n == 1) return cout << r-l+1 << '\n', 0;
	if (n == 2) return cout << (r-l+1) * 1ll * (r-l) << '\n', 0;
	if (n >= N) return cout << "0\n", 0;

	for (int i = 1; i < MX; i ++)
		for (int j = pw[i][0] = 1; j < N; j ++) pw[i][j] = min(pw[i][j-1] * 1ll * i, inf * 1ll);

//

	for (int i = 0; i < maxR; i ++) y[i] = i, t[i] = 1;

	n--;

	for (int i = 2; i < MX; i ++){
		if (nprime[i]) continue;
		d[i] = 1;
		for (int j = 2*i; j < maxR; j += i){
			if (j < MX) nprime[j] = 1;
			if (j % (i*i)) d[j] = 1;
			else {
				d[j] = d[j/i] + 1;
				int x = d[j] / n;
				y[j] /= pw[i][x*n];
				t[j] *= pw[i][x];
			}
		}
	}

	for (int i = l; i <= r; i ++){
		if (y[i] * 1ll * pw[t[i]+1][n] > r) continue;
		int L = t[i]+1, R = MX;
		while (L < R-1){
		  	int mid = (L+R)>>1;
			if (y[i] * 1ll * pw[mid][n] <= r) L = mid;
			else R = mid;
		}
		ans += 2 * (L - t[i]);
	}

	cout << ans << '\n';
}


//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

using namespace std;

int const mod = 1e9+7, MX = 3333, N = 60+3, maxR = 1e7+20, inf = 1e9+10;
int n, l, r, ans, pw[MX][N], d[maxR], y[maxR], t[maxR];
bool nprime[MX];

int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> l >> r;
	if (n == 1) return cout << r-l+1 << '\n', 0;
	if (n == 2) return cout << (r-l+1) * 1ll * (r-l) % mod << '\n', 0;
	if (n >= 60) return cout << "0\n", 0;

	for (int i = 1; i < MX; i ++)
		for (int j = pw[i][0] = 1; j < N; j ++) pw[i][j] = min(pw[i][j-1] * 1ll * i, inf * 1ll);

	for (int i = 0; i < maxR; i ++) y[i] = i, t[i] = 1;

	n--;

	for (int i = 2; i < MX; i ++){
		if (nprime[i]) continue;
		d[i] = 1;
		for (int j = 2*i; j < maxR; j ++){
			if (j < MX) nprime[j] = 1;
			if (j % (i*i)) d[j] = 1;
			else {
				d[j] = d[j/i] + 1;
				int x = d[j] / n;
				y[j] /= pw[i][x*n];
				t[j] *= pw[i][x];
			}
		}
	}

	for (int i = l; i <= r; i ++){
		if (y[i] * 1ll * pw[t[i]+1][n] > r) continue;
		int L = t[i]+1, R = MX;
		while (L < R-1){
		  	int mid = (L+R)>>1;
			if (y[i] * 1ll * pw[mid][n] <= r) L = mid;
			else R = mid;
		}
		ans += 2 * (L - t[i]);
	}

	cout << ans << '\n';
}


//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

using namespace std;

#define int long long

int const MX = 3333, N = 60+3, maxR = 1e7+20, inf = 1e9+10;
int n, l, r, ans, pw[MX][N], d[maxR], y[maxR], t[maxR];
bool nprime[MX];

int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> l >> r;
	if (n == 1) return cout << r-l+1 << '\n', 0;
	if (n == 2) return cout << (r-l+1) * 1ll * (r-l) << '\n', 0;
	if (n >= N) return cout << "0\n", 0;

	for (int i = 1; i < MX; i ++)
		for (int j = pw[i][0] = 1; j < N; j ++) pw[i][j] = min(pw[i][j-1] * 1ll * i, inf * 1ll);

	for (int i = 0; i < maxR; i ++) y[i] = i, t[i] = 1;

	n--;

	for (int i = 2; i < MX; i ++){
		if (nprime[i]) continue;
		d[i] = 1;
		for (int j = 2*i; j < maxR; j ++){
			if (j < MX) nprime[j] = 1;
			if (j % (i*i)) d[j] = 1;
			else {
				d[j] = d[j/i] + 1;
				int x = d[j] / n;
				y[j] /= pw[i][x*n];
				t[j] *= pw[i][x];
			}
		}
	}

	for (int i = l; i <= r; i ++){
		if (y[i] * 1ll * pw[t[i]+1][n] > r) continue;
		int L = t[i]+1, R = MX;
		while (L < R-1){
		  	int mid = (L+R)>>1;
			if (y[i] * 1ll * pw[mid][n] <= r) L = mid;
			else R = mid;
		}
		ans += 2 * (L - t[i]);
	}

	cout << ans << '\n';
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int MAXN = 1E7 + 10;
const ll INF = 1E7 + 10;

ll quickExp(ll e, ll n, ll INF = 1E9 + 10){
	ll ret = 1;
	for (; n; n >>= 1){
		if (n & 1){
			if (INF / ret < e)
				return INF;
			ret *= e;
		}
		e = INF / e < e ? INF : e * e;
	}
	return ret;
}

int sqr(int n, int k){
	int ret = max<int>(1, pow(n - 0.5, 1. / k));
	for (; quickExp(ret, k, n) < n; ++ret);
	return ret;
}

int val[MAXN];

int main(){
	ll n, l, r;
	scanf("%lld%lld%lld", &n, &l, &r);
	if (n == 1)
		printf("%lld\n", r - l + 1);
	else if (n == 2)
		printf("%lld\n", (r - l + 1) * (r - l) / 2);
	else{
		int l0 = sqr(l, n - 1), r0 = sqr(r + 1, n - 1);
		ll ans = 0;
		for (int i = l0; i < r0; ++i){
			val[i] = quickExp(i, n - 1);
			for (int j = l0; j < i; ++j){
				if (__gcd(i, j) > 1)
					continue;
				ans += r / val[i] - (l - 1) / val[j];
			}
		}
		printf("%lld\n", ans << 1);
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int MAXN = 1E7 + 10;
const ll INF = 1E7 + 10;

ll quickExp(ll e, ll n, ll INF = 1E9 + 10){
	ll ret = 1;
	for (; n; n >>= 1){
		if (n & 1){
			if (INF / ret < e)
				return INF;
			ret *= e;
		}
		e = INF / e < e ? INF : e * e;
	}
	return ret;
}

int sqr(int n, int k){
	int ret = max<int>(1, pow(n - 0.5, 1. / k));
	for (; quickExp(ret, k, n) < n; ++ret);
	return ret;
}

int val[MAXN];

int main(){
	ll n, l, r;
	scanf("%lld%lld%lld", &n, &l, &r);
	if (n == 1)
		printf("%lld\n", r - l + 1);
	else if (n == 2)
		printf("%lld\n", (r - l + 1) * (r - l));
	else{
		int l0 = sqr(l, n - 1), r0 = sqr(r + 1, n - 1);
		ll ans = 0;
		for (int i = 1; i < r0; ++i){
			val[i] = quickExp(i, n - 1);
			for (int j = 1; j < i; ++j){
				if (__gcd(i, j) > 1)
					continue;
				ans += max(0ll, r / val[i] - (l - 1) / val[j]);
			}
		}
		printf("%lld\n", ans << 1);
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int MAXN = 1E7 + 10;
const ll INF = 1E7 + 10;

ll quickExp(ll e, ll n, ll INF = 1E9 + 10){
	ll ret = 1;
	for (; n; n >>= 1){
		if (n & 1){
			if (INF / ret < e)
				return INF;
			ret *= e;
		}
		e = INF / e < e ? INF : e * e;
	}
	return ret;
}

int sqr(int n, int k){
	int ret = max<int>(1, pow(n - 0.5, 1. / k));
	for (; quickExp(ret, k, n) < n; ++ret);
	return ret;
}

int val[MAXN];

int main(){
	ll n, l, r;
	scanf("%lld%lld%lld", &n, &l, &r);
	if (n == 1)
		printf("%lld\n", r - l + 1);
	else if (n == 2)
		printf("%lld\n", (r - l + 1) * (r - l));
	else{
		int l0 = sqr(l, n - 1), r0 = sqr(r + 1, n - 1);
		ll ans = 0;
		for (int i = l0; i < r0; ++i){
			val[i] = quickExp(i, n - 1);
			for (int j = l0; j < i; ++j){
				if (__gcd(i, j) > 1)
					continue;
				ans += r / val[i] - (l - 1) / val[j];
			}
		}
		printf("%lld\n", ans << 1);
	}
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long LL;
const int MAX_N = 1e7 + 6;

LL pow(LL a,LL n) {
	if (n==1) return a;
	else if (n==0) return 1;
	else {
		LL ret=pow(a,n/2);
		if (ret>MAX_N) return MAX_N;
		ret *= ret;
		if (ret>MAX_N) return MAX_N;
		if (n&1) ret*=a;
		if (ret>MAX_N) return MAX_N;
		return ret;
	}
}

int main () {
	LL n,l,r;
	while (scanf("%I64d %I64d %I64d",&n,&l,&r) != EOF) {
		if (n==1) printf("%I64d\n",r-l+1);
		else if (n==2) printf("%I64d\n",(r-l)*(r-l+1));
		if(n<=2) continue;
		vector<LL> v;
		for(int i=1;;i++) {
			LL ret=pow(i,n-1);
			if (ret>r) break;
			v.push_back(ret);
		}
		int sz=v.size();
		LL ans=0;
		for (int i=sz-1;i>=0;i--) {
			LL mx=r/v[i];
			for (int j=i-1;j>=0;j--) {
				if (__gcd(i+1,j+1) != 1) continue;
				LL mn=(l-1)/v[j]+1;
				//cout<<"i = "<<i<<" , j = "<<j<<" , mn = "<<mn<<" , mx = "<<mx<<endl;
				if (mx>=mn)ans += (mx-mn+1);
			}
		}
		printf("%I64d\n",2*ans);
	}
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long LL;
const int MAX_N = 1e7 + 6;

LL pow1(LL a,LL n) {
	if (n==1) return a;
	else if (n==0) return 1;
	else {
		LL ret=pow1(a,n/2);
		if (ret>MAX_N) return MAX_N;
		ret *= ret;
		if (ret>MAX_N) return MAX_N;
		if (n&1) ret*=a;
		if (ret>MAX_N) return MAX_N;
		return ret;
	}
}

int main () {
	LL n,l,r;
	while (scanf("%I64d %I64d %I64d",&n,&l,&r) != EOF) {
		if (n==1) printf("%I64d\n",r-l+1);
		else if (n==2) printf("%I64d\n",(r-l)*(r-l+1));
		if(n<=2) continue;
		vector<LL> v;
		for(int i=1;;i++) {
			LL ret=pow1(i,n-1);
			if (ret>r) break;
			v.push_back(ret);
		}
		int sz=v.size();
		LL ans=0;
		for (int i=sz-1;i>=0;i--) {
			LL mx=r/v[i];
			for (int j=i-1;j>=0;j--) {
				if (__gcd(i+1,j+1) != 1) continue;
				LL mn=(l-1)/v[j]+1;
				//cout<<"i = "<<i<<" , j = "<<j<<" , mn = "<<mn<<" , mx = "<<mx<<endl;
				if (mx>=mn)ans += (mx-mn+1);
			}
		}
		printf("%I64d\n",2*ans);
	}
}


#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;

typedef long long LL;
const int MAX_N = 1e7 + 6;

LL pow(LL a,LL n) {
	if (n==1) return a;
	else if (n==0) return 1;
	else {
		LL ret=pow(a,n/2);
		if (ret>MAX_N) return MAX_N;
		ret *= ret;
		if (ret>MAX_N) return MAX_N;
		if (n&1) ret*=a;
		if (ret>MAX_N) return MAX_N;
		return ret;
	}
}

int main () {
	LL n,l,r;
	while (scanf("%I64d %I64d %I64d",&n,&l,&r) != EOF) {
		if (n==1) printf("%I64d\n",r-l+1);
		else if (n==2) printf("%I64d\n",(r-l)*(r-l+1));
		if(n<=2) continue;
		vector<LL> v;
		for(int i=1;;i++) {
			LL ret=pow(i,n-1);
			if (ret>r) break;
			v.push_back(ret);
		}
		int sz=v.size();
		LL ans=0;
		for (int i=sz-1;i>=0;i--) {
			LL mx=r/v[i];
			for (int j=i-1;j>=0;j--) {
				LL mn=(l-1)/v[j]+1;
				//cout<<"i = "<<i<<" , j = "<<j<<" , mn = "<<mn<<" , mx = "<<mx<<endl;
				if (mx>=mn)ans += (mx-mn+1);
			}
		}
		printf("%I64d\n",2*ans);
	}
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1e7 + 10;
int fact[N];
int P[N]; int num;
int _count[N];

void factorise(int n) {
	num = 0;
	while(n>1) {
		int p = fact[n];
		int cnt = 0;
		while(fact[n] == p) cnt++, n/=p;
		P[num] = p; _count[num] = cnt;
		num++;
	}
}

int powm(int a, int b) {
	int ans = 1;
	while(b) {
		if(b&1) ans *= a;
		a *= a;
		b >>= 1;
	}
	return ans;
}

long long solve(int n, int l, int r) {
	if(n==1) return r-l+1;
	if(n==2) {
		return (r-l+1)*1ll*(r-l);
	}
	long long ans = 0;
	for(int j=l; j<=r; j++) {
		factorise(j);
		vector<int> p;
		for(int k=0; k<num; k++) {
			for(int l=1; 1; l++)
				if(_count[k] >= l*(n-1))
					p.push_back(l*P[k]);
				else break;

		}

		int sz = p.size();
		int cy = 1<<sz;

		for(int den=0; den<cy; den++) {
			int pri = 1;
			int dd = -1;
			for(int k=0; k<sz; k++)
				if(den&(1<<k))  {
					pri *= p[k];
					if(dd == -1) dd = p[k];
					else dd = __gcd(dd, p[k]);
				}
			if(dd>1 && __builtin_popcount(den)>1) continue;
			int val = j/powm(pri,n-1);
			int c = r/val;
			long double f = pow(1.*c, 1./(n-1));
			int gh = (int)(f+1e-6);
			if(gh>pri) ans += gh-pri;
		}
	}
	return ans<<1;
}

int main() {

	fact[1] = 1;
	for(int i=2; i*i<N; i++) {
		if(!fact[i])
			for(int j=i*i; j<N; j+=i)
				if(!fact[j])
					fact[j] = i;
	}

	for(int i=2; i<N; i++)
		if(!fact[i])
			fact[i] = i;

	int n, l, r;
	cin >> n >> l >> r;
	cout << solve(n,l,r) << endl;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1e7 + 10;
int fact[N];
int P[N]; int num;
int _count[N];

void factorise(int n) {
	num = 0;
	while(n>1) {
		int p = fact[n];
		int cnt = 0;
		while(fact[n] == p) cnt++, n/=p;
		P[num] = p; _count[num] = cnt;
		num++;
	}
}

int powm(int a, int b) {
	int ans = 1;
	while(b) {
		if(b&1) ans *= a;
		a *= a;
		b >>= 1;
	}
	return ans;
}

long long solve(int n, int l, int r) {
	if(n==1) return r-l+1;
	if(n==2) {
		return (r-l+1)*1ll*(r-l);
	}
	long long ans = 0;
	for(int j=l; j<=r; j++) {
		factorise(j);
		vector<int> p;
		for(int k=0; k<num; k++) {
			for(int l=1; 1; l++)
				if(_count[k] >= l*(n-1))
					p.push_back(l*P[k]);
				else break;

		}

		int sz = p.size();
		int cy = 1<<sz;

		for(int den=0; den<cy; den++) {
			int pri = 1;
			int dd = -1;
			for(int k=0; k<sz; k++)
				if(den&(1<<k))  {
					pri *= p[k];
					if(dd == -1) dd = p[k];
					else dd = __gcd(dd, p[k]);
				}
			if(dd > 1) continue;
			int val = j/powm(pri,n-1);
			int c = r/val;
			long double f = pow(1.*c, 1./(n-1));
			int gh = (int)(f+1e-6);
			// cout << c << " " << pri << " " << " " << j << " " << gh << endl;
			if(gh>pri) ans += gh-pri;
		}
	}
	return ans<<1;
}

int main() {

	fact[1] = 1;
	for(int i=2; i*i<N; i++) {
		if(!fact[i])
			for(int j=i*i; j<N; j+=i)
				if(!fact[j])
					fact[j] = i;
	}

	for(int i=2; i<N; i++)
		if(!fact[i])
			fact[i] = i;

	int n, l, r;
	cin >> n >> l >> r;
	cout << solve(n,l,r) << endl;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1e7 + 10;
int fact[N];
int P[N]; int num;
int _count[N];

void factorise(int n) {
	num = 0;
	while(n>1) {
		int p = fact[n];
		int cnt = 0;
		while(fact[n] == p) cnt++, n/=p;
		P[num] = p; _count[num] = cnt;
		num++;
	}
}

int powm(int a, int b) {
	int ans = 1;
	while(b) {
		if(b&1) ans *= a;
		a *= a;
		b >>= 1;
	}
	return ans;
}

long long solve(int n, int l, int r) {
	if(n==1) return r-l+1;
	if(n==2) {
		return (r-l+1)*1ll*(r-l);
	}
	long long ans = 0;
	for(int j=l; j<=r; j++) {
		factorise(j);
		vector<int> p, o;
		for(int k=0; k<num; k++) {
			for(int l=1; 1; l++)
				if(_count[k] >= l*(n-1))
					p.push_back(powm(P[k], l)), o.push_back(l);
				else break;

		}

		int sz = p.size();
		int cy = 1<<sz;

		// cout << j << endl;
		// for(int i=0; i<sz; i++) cout << p[i] << " \n"[i==sz-1];

		for(int den=0; den<cy; den++) {
			int pri = 1;
			int dd = -1;
			int flag = 0;
			for(int k=0; k<sz; k++)
				if(den&(1<<k))  {
					pri *= p[k];
					if(den & ( ((1<<k)-1) - ((1<<(k-o[k]+1))-1) ) ) flag = 1;
				}
			// cout << den << " " << pri << " " << flag << endl;
			if(flag) continue;
			int val = j/powm(pri,n-1);
			int c = r/val;
			long double f = pow(1.*c, 1./(n-1));
			int gh = (int)(f+1e-6);
			// cout << j << " " << c << " " << pri << " " << gh << " " << den << " " << sz << endl;
			if(gh>pri) ans += gh-pri;
		}
	}
	return ans<<1;
}

int main() {

	fact[1] = 1;
	for(int i=2; i*i<N; i++) {
		if(!fact[i])
			for(int j=i*i; j<N; j+=i)
				if(!fact[j])
					fact[j] = i;
	}

	for(int i=2; i<N; i++)
		if(!fact[i])
			fact[i] = i;

	int n, l, r;
	cin >> n >> l >> r;
	cout << solve(n,l,r) << endl;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 1e7 + 10;
int fact[N];
int P[N]; int num;
int _count[N];
int dp[3300][3300];

void factorise(int n) {
	num = 0;
	while(n>1) {
		int p = fact[n];
		int cnt = 0;
		while(fact[n] == p) cnt++, n/=p;
		P[num] = p; _count[num] = cnt;
		num++;
	}
}

int powm(int a, int b) {
	int ans = 1;
	while(b) {
		if(b&1) ans *= a;
		a *= a;
		b >>= 1;
	}
	return ans;
}

long long solve(int n, int l, int r) {
	if(n==1) return r-l+1;
	if(n==2) {
		return (r-l+1)*1ll*(r-l);
	}
	long long ans = 0;
	for(int j=l; j<=r; j++) {
		factorise(j);
		vector<int> p, o;
		for(int k=0; k<num; k++) {
			for(int l=1; 1; l++)
				if(_count[k] >= l*(n-1))
					p.push_back(powm(P[k], l)), o.push_back(l);
				else break;

		}

		int sz = p.size();
		int cy = 1<<sz;

		for(int den=0; den<cy; den++) {
			int pri = 1;
			int dd = -1;
			int flag = 0;
			for(int k=0; k<sz; k++)
				if(den&(1<<k))  {
					pri *= p[k];
					if(den & ( ((1<<k)-1) - ((1<<(k-o[k]+1))-1) ) ) flag = 1;
				}
			if(flag) continue;
			int val = j/powm(pri,n-1);
			int c = r/val;
			long double f = pow(1.*c, 1./(n-1));
			int gh = (int)(f+1e-6);
			// if(gh>pri)cout << j << " " << c << " " << pri << " " << gh << endl;
			if(gh>pri) ans += dp[pri][gh];
		}
	}
	return ans<<1;
}

int main() {

	for(int i=1; i<3300; i++) {
		dp[i][i] = 0;
		for(int j=i+1; j<3300; j++)
			dp[i][j] = dp[i][j-1] + (__gcd(i,j)==1);
	}

	fact[1] = 1;
	for(int i=2; i*i<N; i++) {
		if(!fact[i])
			for(int j=i*i; j<N; j+=i)
				if(!fact[j])
					fact[j] = i;
	}

	for(int i=2; i<N; i++)
		if(!fact[i])
			fact[i] = i;

	int n, l, r;
	cin >> n >> l >> r;
	cout << solve(n,l,r) << endl;
}


#include<cstdio>
#include<algorithm>
#define int long long
int n,l,r,POW[10010],ans;
int quickpow(int x,int y){
	int res=1;
	for(;y;y>>=1){
		if(y&1)res=res*x;
		x=x*x;
	}
	return res;
}
signed main(){
	scanf("%lld%lld%lld",&n,&l,&r);
	if(n>=25)return puts("0"),0;
	if(n==1)return printf("%lld\n",r-l+1),0;
	if(n==2)return printf("%lld\n",(r-l+1)*(r-l)),0;
	for(int i=1;;i++){
		POW[i]=quickpow(i,n-1);
		if(POW[i]>r)break;
	}
	for(int i=1;POW[i]<=r;i++)
		for(int j=1;POW[j]<=r;j++){
			if(i==1&&j==1)continue;
			if(std::__gcd(i,j)!=1)continue;
			int L=std::max((l+POW[i]-1)/POW[i],(l+POW[j]-1)/POW[j]);
			int R=std::min(r/POW[i],r/POW[j]);
			ans+=std::max(0ll,R-L+1);
		}
	printf("%lld\n",ans);
}


#include<cstdio>
#include<algorithm>
int n,l,r,POW[10010],ans;
int quickpow(int x,int y){
	int res=1;
	for(;y;y>>=1){
		if(y&1)res=res*x;
		x=x*x;
	}
	return res;
}
int main(){
	scanf("%d%d%d",&n,&l,&r);
	if(n>=25)return puts("0"),0;
	if(n==1)return printf("%d\n",r-l+1),0;
	if(n==2)return printf("%d\n",(r-l+1)*(r-l)),0;
	for(int i=1;;i++){
		POW[i]=quickpow(i,n-1);
		if(POW[i]>r)break;
	}
	for(int i=1;POW[i]<=r;i++)
		for(int j=1;POW[j]<=r;j++){
			if(i==1&&j==1)continue;
			if(std::__gcd(i,j)!=1)continue;
			int L=std::max((l+POW[i]-1)/POW[i],(l+POW[j]-1)/POW[j]);
			int R=std::min(r/POW[i],r/POW[j]);
			ans+=std::max(0,R-L+1);
		}
	printf("%d\n",ans);
}


#include <iostream>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <deque>
#include <bitset>
#include <algorithm>

using namespace std;

const double eps=1e-10;
const double pi=3.1415926535897932384626433832795;
const double eln=2.718281828459045235360287471352;

#define LL long long
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
#define scan(x) scanf("%d", &x)
#define scan2(x, y) scanf("%d%d", &x, &y)
#define scan3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define sqr(x) (x) * (x)
#define pr(x) printf("Case %d: ",x)
#define prn(x) printf("Case %d:\n",x)
#define prr(x) printf("Case #%d: ",x)
#define prrn(x) printf("Case #%d:\n",x)
#define lowbit(x) (x&(-x))

LL n,l,r;
LL i,j,k,m,ans;

LL mi(LL x,LL y)
{
    LL ans=1;
    while(y>0)
    {
        if(y&1)ans*=x;
        x*=x;
        y>>=1;
    }
    return ans;
}

LL find(LL x,LL y)
{
    if(x>=25)return 1;
    LL t=x;
    LL u=y;
    while(t>1)
    {
        y=(LL)(sqrt(y)+1);
        t>>=1;
    }
    LL ll=1,rr=y;
    while(rr-ll>1)
    {
        LL mid=(ll+rr)>>1;
        if(mi(mid,x)>u)rr=mid;else ll=mid;
    }
    if(mi(rr,x)>u)rr--;
    return rr;
}

LL gcd(LL x,LL y)
{
    if(x==0)return y;
    if(y==0)return x;
    return gcd(y,x%y);
}

int main()
{
    scanf("%lld %lld %lld",&n,&l,&r);
    if(n==1){printf("%lld",r-l+1);return 0;}
    if(n==2)
    {
        LL len=r-l+1;
        printf("%lld",len*(len-1));
        return 0;
    }
    LL xr=find(n-1,r);
    for(i=2;i<=xr;i++)
    {
        for(j=1;j<i;j++)
        {
            if(gcd(i,j)!=1)continue;
            LL p=mi(i,n-1);
            LL q=mi(j,n-1);
            LL le,ri;
            if(l%q==0)le=l/q;else le=l/q+1;
            ri=r/p;
            if(ri>=le)ans+=(ri-le+1)*2;
        }
    }
    printf("%lld",ans);
    return 0;
}


#include <iostream>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <deque>
#include <bitset>
#include <algorithm>

using namespace std;

const double eps=1e-10;
const double pi=3.1415926535897932384626433832795;
const double eln=2.718281828459045235360287471352;

#define LL long long
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
#define scan(x) scanf("%d", &x)
#define scan2(x, y) scanf("%d%d", &x, &y)
#define scan3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define sqr(x) (x) * (x)
#define pr(x) printf("Case %d: ",x)
#define prn(x) printf("Case %d:\n",x)
#define prr(x) printf("Case #%d: ",x)
#define prrn(x) printf("Case #%d:\n",x)
#define lowbit(x) (x&(-x))

LL n,l,r;
LL i,j,k,m,ans;

LL mi(LL x,LL y)
{
    LL ans=1;
    while(y>0)
    {
        if(y&1)ans*=x;
        x*=x;
        y>>=1;
    }
    return ans;
}

LL find(LL x,LL y)
{
    LL t=x;
    LL u=y;
    while(t>1)
    {
        y=(LL)(sqrt(y)+1);
        t>>=1;
    }
    LL ll=1,rr=y;
    while(rr-ll>1)
    {
        LL mid=(ll+rr)>>1;
        if(mi(mid,x)>u)rr=mid;else ll=mid;
    }
    if(mi(rr,x)>u)rr--;
    return rr;
}

LL gcd(LL x,LL y)
{
    if(x==0)return y;
    if(y==0)return x;
    return gcd(y,x%y);
}

int main()
{
    scanf("%lld %lld %lld",&n,&l,&r);
    if(n==1){printf("%lld",r-l+1);return 0;}
    if(n==2)
    {
        LL len=r-l+1;
        printf("%lld",len*(len-1));
        return 0;
    }
    LL xr=find(n-1,r);
    for(i=2;i<=xr;i++)
    {
        for(j=1;j<i;j++)
        {
            if(gcd(i,j)!=1)continue;
            LL p=mi(i,n-1);
            LL q=mi(j,n-1);
            LL le,ri;
            if(l%q==0)le=l/q;else le=l/q+1;
            ri=r/p;
            if(ri>=le)ans+=(ri-le+1)*2;
        }
    }
    printf("%lld",ans);
    return 0;
}


#include <iostream>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <deque>
#include <bitset>
#include <algorithm>

using namespace std;

const double eps=1e-10;
const double pi=3.1415926535897932384626433832795;
const double eln=2.718281828459045235360287471352;

#define LL long long
#define IN freopen("in.txt", "r", stdin)
#define OUT freopen("out.txt", "w", stdout)
#define scan(x) scanf("%d", &x)
#define scan2(x, y) scanf("%d%d", &x, &y)
#define scan3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define sqr(x) (x) * (x)
#define pr(x) printf("Case %d: ",x)
#define prn(x) printf("Case %d:\n",x)
#define prr(x) printf("Case #%d: ",x)
#define prrn(x) printf("Case #%d:\n",x)
#define lowbit(x) (x&(-x))

LL n,l,r;
LL i,j,k,m,ans;

LL mi(LL x,LL y)
{
    LL ans=1;
    while(y>0)
    {
        if(y&1)ans*=x;
        x*=x;
        y>>=1;
    }
    return ans;
}

LL find(LL x,LL y)
{
    LL t=x;
    LL u=y;
    while(t>1)
    {
        y=(LL)(sqrt(y)+1);
        t>>=1;
    }
    LL ll=1,rr=y;
    while(rr-ll>1)
    {
        LL mid=(ll+rr)>>1;
        if(mi(mid,x)>u)rr=mid;else ll=mid;
    }
    if(mi(rr,x)>u)rr--;
    return rr;
}

LL gcd(LL x,LL y)
{
    if(x==0)return y;
    if(y==0)return x;
    return gcd(y,x%y);
}

int main()
{
    scanf("%lld %lld %lld",&n,&l,&r);
    if(n==1){printf("%lld",r-l+1);return 0;}
    if(n==2)
    {
        LL len=r-l+1;
        printf("%lld",len*(len-1));
        return 0;
    }
    LL xr=find(n-1,r);
    for(i=1;i<=xr;i++)
    {
        for(j=1;j<i;j++)
        {
            if(gcd(i,j)!=1)continue;
            LL p=mi(i,n-1);
            LL q=mi(j,n-1);
            LL w=r*q/p;
            if(w<l)continue;
            w=w-l+1;
            if(w%q==0)w/=q;else w=w/q+1;
            ans+=w*2;
        }
    }
    printf("%lld",ans);
    return 0;
}


#include <iostream>
using namespace std;
int N, L, R;
bool powLog(int n, int p, int nb)
{
    int sol = 1;
    while(p)
    {
        if(p % 2 == 1)
        {
            if(sol > nb / n)
                return 0;
            sol = sol * n;
        }
        if(n > nb / n && p > 1)
            return 0;
        n = n * n;
        p /= 2;
    }
    return 1;
}
int power(int n, int p)
{
    int sol = 1;
    while(p)
    {
        if(p % 2 == 1)
            sol = sol * n;
        n = n * n;
        p /= 2;
    }
    return sol;
}
int binarySearch()
{
    int left = 1, right = R, sol = 1, mid;
    while(left <= right)
    {
        mid = (left + right) / 2;
        if(powLog(mid, N - 1, R) == 1)
        {
            sol = mid;
            left = mid + 1;
        }
        else
            right = mid - 1;
    }
    return sol;
}
int GCD(int a, int b)
{
    int r = a % b;
    while(r != 0)
    {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}
void Solve()
{
    int lim = binarySearch();
    int ans = 0;
    for(int i = 1; i <= lim; i++)
        for(int j = i + 1; j <= lim; j++)
        {
            int g = GCD(i, j);
            if(g > 1)
                continue;
            int l, r = R / power(j, N - 1);
            l = L / power(i, N - 1);
            if(L % power(i, N - 1) == 0)
                --l;
            ans += max(0, r - l);
        }
    cout << ans * 2 << "\n";
}
int main()
{
    cin >> N >> L >> R;
    if(N == 1)
    {
        cout << R - L + 1 << "\n";
        return 0;
    }
    if(N == 2)
    {
        cout << (1LL * (R - L + 1) * (R - L)) << "\n";
        return 0;
    }
    Solve();
    return 0;
}


#include <iostream>
using namespace std;
int N, L, R;
bool powLog(int n, int p, int nb)
{
    int sol = 1;
    while(p)
    {
        if(p % 2 == 1)
        {
            if(sol > nb / n)
                return 0;
            sol = sol * n;
        }
        if(n > nb / n && p > 1)
            return 0;
        n = n * n;
        p /= 2;
    }
    return 1;
}
int power(int n, int p)
{
    int sol = 1;
    while(p)
    {
        if(p % 2 == 1)
            sol = sol * n;
        n = n * n;
        p /= 2;
    }
    return sol;
}
int binarySearch()
{
    int left = 1, right = R, sol = 1, mid;
    while(left <= right)
    {
        mid = (left + right) / 2;
        if(powLog(mid, N - 1, R) == 1)
        {
            sol = mid;
            left = mid + 1;
        }
        else
            right = mid - 1;
    }
    return sol;
}
int GCD(int a, int b)
{
    int r = a % b;
    while(r != 0)
    {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}
void Solve()
{
    int lim = binarySearch();
    int ans = 0;
    for(int i = 1; i <= lim; i++)
        for(int j = i + 1; j <= lim; j++)
        {
            int g = GCD(i, j);
            if(powLog(i, N - 1, L - 1) == 1 || g > 1)
                continue;
            int l, r = R / power(j, N - 1);
            l = L / power(i, N - 1);
            if(L % power(i, N - 1) == 0)
                --l;
            ans += r - l;
        }
    cout << ans * 2 << "\n";
}
int main()
{
    cin >> N >> L >> R;
    if(N == 1)
    {
        cout << R - L + 1 << "\n";
        return 0;
    }
    if(N == 2)
    {
        cout << (1LL * (R - L + 1) * (R - L)) << "\n";
        return 0;
    }
    Solve();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long

ll mypow(ll x,ll c){
	ll ret=1;
	while(c){
		if(c&1)ret*=x;
		x*=x;
		c/=2;
	}
	return ret;
}

int main(){
	ll n,l,r;
	cin>>n>>l>>r;
	ll ret=0;
	if(n==1){
		cout<<(r-l+1)<<endl;
	}
	else if(n==2){
		cout<<(r-l+1)*(r-l)<<endl;
	}
	else if(n>25){
		cout<<0<<endl;
	}
	else{
		ll i,j,x,y,u,m;bool is=1;
		m= pow(2,log2(1e8)/(n-1));
		m= min(m,3200LL);
		for(i=1;i<m;++i){
			for(j=i+1;j<=m;++j){
				if(__gcd(i,j)==1){
					x= mypow(i,n-1);
					y= mypow(j,n-1);
					if((l*y)/x>r){
						break;
					}
					ret+= (r*x/y)/x-(l-1)/x;
				}
			}
		}
		cout<<ret*2<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long

ll mypow(ll x,ll c){
	ll ret=1;
	while(c){
		if(c&1)ret*=x;
		x*=x;
		c/=2;
	}
	return ret;
}

int main(){
	ll n,l,r;
	cin>>n>>l>>r;
	ll ret=0;
	if(n==1){
		cout<<(r-l+1)<<endl;
	}
	else if(n==2){
		cout<<(r-l+1)*(r-l)<<endl;
	}
	else if(n>25){
		cout<<0<<endl;
	}
	else{
		ll i,j,x,y,u;bool is=1;
		for(i=1;is;++i){
			for(j=i+1;;++j){
				if(__gcd(i,j)==1){
					x= mypow(i,n-1);
					if(x>r){is=0;break;}
					y= mypow(j,n-1);
					if((l*y)/x>r){
						break;
					}
					ret+= (r*x/y)/x-(l-1)/x;
				}
			}
		}
		cout<<ret*2<<endl;
	}
}