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