#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
using namespace chrono;
using ull = unsigned long long;
void Code_By_Mohamed_Khaled() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
const ll mod = 1e9 + 7;
ll add(ll a, ll b) { return ((a % mod) + (b % mod)) % mod; }
ll mul(ll a, ll b) { return (__int128(a) * b) % mod; }
ll sub(ll a, ll b) { return ((a % mod) - (b % mod) + mod) % mod; }
ll power(ll a, ll b, ll m) {
    ll res = 1;
    a %= m;
    while (b > 0) {
        if (b & 1) res = (__int128)res * a % m;
        a = (__int128)a * a % m;
        b >>= 1;
    }
    return res;
}
bool is_prime(ll n) {
    if (n < 2) return false;
    for (ll p : {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37}) {
        if (n == p) return true;
        if (n % p == 0) return false;
    }
    ll r = 0, d = n - 1;
    while ((d & 1) == 0) d >>= 1, r++;
    for (ll a : {2, 3, 5, 7, 11}) {
        if (a >= n) continue;
        ll x = power(a, d, n);
        if (x == 1 || x == n - 1) continue;
        bool ok = false;
        for (ll i = 0; i < r - 1; i++) {
            x = (__int128)x * x % n;
            if (x == n - 1) {
                ok = true;
                break;
            }
        }
        if (!ok) return false;
    }
    return true;
}
ll pollards_rho(ll n) {
    if (n % 2 == 0) return 2;
    if (is_prime(n)) return n;
    while (true) {
        ll x = rand() % (n - 2) + 2;
        ll y = x;
        ll c = rand() % (n - 1) + 1;
        ll d = 1;
        while (d == 1) {
            x = (__int128)x * x % n;
            x = (x + c) % n;
            y = (__int128)y * y % n;
            y = (y + c) % n;
            y = (__int128)y * y % n;
            y = (y + c) % n;
            d = __gcd(abs(x - y), n);
        }
        if (d != n) return d;
    }
}
void pollard_fact(ll n, map<ll,ll>&mp) {
    if (n == 1) return;
    if (is_prime(n)) {
        mp[n]++;
        return;
    }
    ll f = pollards_rho(n);
    pollard_fact(f, mp);
    pollard_fact(n / f, mp);
}
ll cnt_pairs(ll k) {
    map<ll,ll>mp;
    pollard_fact(k,mp);
    return 1LL<<mp.size();
}
vector<ll> get_divisors(ll n) {
    vector<ll> div;
    for (ll b = 1; b * b <= n; b++) {
        if (n % b == 0) {
            div.push_back(b);
            if (b * b != n) div.push_back(n / b);
        }
    }
    return div;
}
int main() {
	auto start = high_resolution_clock::now();
    Code_By_Mohamed_Khaled();
    // srand(time(0));
    ll t=1;
    while(t--){
	    ll c,d,x;
	    cin>>c>>d>>x;
	    vector<ll>div=get_divisors(x);
	    ll ans=0;
	    for (auto it:div) {
	        ll g=it,k=x/g+d;
	        if (k%c) continue;
	        k/=c;
	        ans+=cnt_pairs(k);
	    }
	    cout<<ans<<"\n";
    }
    auto end = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(end - start);
    cout << "Time taken: " << duration.count() << " microseconds" << endl;
    return 0;
}
