#include <bits/stdc++.h>
using namespace std;
const int inv = 1000000000;
const int minv = -inv;
int l, r, x, y;
int fgcd(int a, int b) {
  if (a == 0)
    return b;
  else
    return fgcd(b % a, a);
}
int main() {
  scanf("%d", &l);
  scanf("%d", &r);
  scanf("%d", &x);
  scanf("%d", &y);
  if (y % x != 0) {
    printf("%d\n", 0);
    return 0;
  }
  int gamma = y / x;
  int res = 0;
  for (int alpha = 1; alpha * alpha <= gamma; ++alpha)
    if (gamma % alpha == 0) {
      int beta = gamma / alpha;
      if (fgcd(alpha, beta) == 1 and l <= alpha * x and beta * x <= r)
        res += (alpha == beta ? 1 : 2);
    }
  printf("%d\n", res);
  return 0;
}
