#include <bits/stdc++.h>
using namespace std;
ostream& operator<<(ostream& os, const pair<int, int>& pai) {
  os << pai.first << ' ' << pai.second;
  return os;
}
istream& operator>>(istream& is, pair<int, int>& pai) {
  is >> pai.first >> pai.second;
  return is;
}
int l, r, x, y;
int ans = 0;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> l >> r >> x >> y;
  int value = y / x;
  for (long long i = 1; i * i <= value; i++) {
    if (value % i == 0) {
      long long v1 = i;
      long long v2 = value / i;
      long long a = x * v1;
      long long b = x * v2;
      if (gcd(v1, v2) == 1) {
        if (a >= l && a <= r && b >= l && b <= r && y == x * v1 * v2)
          ans += (a == b ? 1 : 2);
      }
    }
  }
  cout << ans << '\n';
  ;
  return 0;
}
