#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int l, r, x, y;
  cin >> l >> r >> x >> y;
  if (y % x) {
    cout << 0 << endl;
    return 0;
  }
  int a = l / x;
  if (l % x) a++;
  int b = r / x;
  y /= x;
  int ans = 0;
  for (int i = 1; i <= sqrt(y); i++) {
    int c = i;
    int d = y / i;
    if (y % i) continue;
    if (gcd(c, d) > 1) continue;
    if (a <= c && c <= b && a <= d && d <= b) {
      if (c == d)
        ans++;
      else
        ans += 2;
    }
  }
  cout << ans << endl;
  return 0;
}
