#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
template<class T1,class T2> bool cmin(T1 &x,const T2 &y) { if (y<x) { x=y; return 1; }return 0; }
template<class T1,class T2> bool cmax(T1 &x,const T2 &y) { if (x<y) { x=y; return 1; }return 0; }
#define all(x) (x).begin(),(x).end()
const int N=5e5+5;
const ll inf=1e14;
vector<int> d[N];
int pool[N*2],*cnt=pool+N;
ll ksm(ll x,ll y)
{
if (abs(x)>=2&&y>=40||pow(abs(x),y)>inf) return inf;
ll r=1;
while (y)
{
if (y&1) r*=x;
x*=x; y>>=1;
}
return r;
}
int main()
{
ios::sync_with_stdio(0); cin.tie(0);
int n,m,q,i,j,a,b;
for (i=1; i<N; i++) for (j=i; j<N; j+=i) d[j].push_back(i);
while (cin>>n>>m>>q)
{
int ans=0;
for (b=-m; b<=m; b++)
{
vector<int> cl;
cerr<<"? "<<b<<endl;
if (b==0)
{
for (int x=)
}
else for (int _:d[abs(b)])
{
for (int x:{_,-_})
{
ll A=ksm(x,n);
if (A==inf) continue;
A+=b;
if (A%x) continue;
A/=x;
if (abs(A)<=m)
{
cl.push_back(A);
++cnt[A];
}
}
}
sort(all(cl)); cl.resize(unique(all(cl))-cl.begin());
for (int x:cl) ans+=cnt[x]==q,cnt[x]=0;
}
cout<<ans<<'\n';
}
}