#include <bits/stdc++.h>
using namespace std;
long long const mod = 1e9 + 7;
long long power(long long x, long long y, long long mod = 2e18) {
  long long ans = 1;
  x %= mod;
  while (y) {
    if (y & 1) ans = (x * ans) % mod;
    x = (x * x) % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long l, r, x, y;
  cin >> l >> r >> x >> y;
  long long sq = sqrt(y);
  set<long long> factors;
  for (long long i = 1; i <= sq; ++i) {
    if (y % i == 0) {
      factors.insert(i);
      factors.insert(y / i);
    }
  }
  long long ans = 0;
  for (auto &a : factors) {
    if (l <= a and a <= r) {
      long long b = (x * y) / a;
      if (l <= b and b <= r and gcd(a, b) == x) {
        ++ans;
      }
    }
  }
  cout << ans;
  return 0;
}
