#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  return (a % b == 0) ? b : gcd(b, a % b);
}
int main() {
  long long l, r, x, y;
  scanf("%lld%lld%lld%lld", &l, &r, &x, &y);
  vector<pair<long long, long long>> v;
  long long p = x * y;
  for (long long i = x; i <= floor(sqrt(p)); i++) {
    if (p % i == 0) {
      v.push_back({i, p / i});
    }
    i = i + x - 1;
  }
  long long ans = 0;
  for (auto item : v) {
    long long a = item.first;
    long long b = item.second;
    if (a >= l && a <= r && b >= l && b <= r) {
      long long u = gcd(a, b);
      long long v = (a * b) / u;
      if (u == x && v == y) {
        if (a == b)
          ans = ans + 1;
        else
          ans = ans + 2;
      }
    }
  }
  cout << ans;
}
