import java.util.HashSet; import java.util.Scanner; public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int w = sc.nextInt();
int x = sc.nextInt();
int y = sc.nextInt();
int z = sc.nextInt();
HashSet<Double> hs = new HashSet<>();
for(int i =w;i<x+1;i++){
for(int j=y;j<z+1;j++){
hs.add((double) ((double)i/(double)j));
}
}
System.out.println(hs.size());
}
}