Iahub and his friend Floyd have started painting a wall. Iahub is painting the wall red and Floyd is painting it pink. You can consider the wall being made of a very large number of bricks, numbered 1, 2, 3 and so on. 

Iahub has the following scheme of painting: he skips x - 1 consecutive bricks, then he paints the x-th one. That is, he'll paint bricks x, 2·x, 3·x and so on red. Similarly, Floyd skips y - 1 consecutive bricks, then he paints the y-th one. Hence he'll paint bricks y, 2·y, 3·y and so on pink.

After painting the wall all day, the boys observed that some bricks are painted both red and pink. Iahub has a lucky number a and Floyd has a lucky number b. Boys wonder how many bricks numbered no less than a and no greater than b are painted both red and pink. This is exactly your task: compute and print the answer to the question. 

Input

The input will have a single line containing four integers in this order: x, y, a, b. (1 ≤ x, y ≤ 1000, 1 ≤ a, b ≤ 2·109, a ≤ b).

Output

Output a single integer — the number of bricks numbered no less than a and no greater than b that are painted both red and pink.

Examples

Input

2 3 6 18


Output

3

Note

Let's look at the bricks from a to b (a = 6, b = 18). The bricks colored in red are numbered 6, 8, 10, 12, 14, 16, 18. The bricks colored in pink are numbered 6, 9, 12, 15, 18. The bricks colored in both red and pink are numbered with 6, 12 and 18. 
import java.io.BufferedReader;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.*;


/**
 * Author: Luis Manuel Díaz Barón
 * Problem:
 * Online Judge:
 * Idea:
 *
 */

public class Main {

    static MyScanner sc;
    static MyWriter mw;
    static String filePath="d:\\lmo.in";


    public static void main(String[] args) throws IOException {

        sc = new MyScanner(System.in);
       // sc = new MyScanner(new FileReader(filePath));
        mw = new MyWriter(System.out);

        while(sc.canRead())
            SolveSingleProblem();

        mw.close();
    }


    public static void SolveSingleProblem() throws IOException{


        int x = sc.nextInt();
        int y = sc.nextInt();

        int a = sc.nextInt();
        int b = sc.nextInt();

        int mm = mcm(x, y);

        while( a % mm != 0 && a < b)
            a++;

        int len = b - a;

        if(a%mm  == 0)
            mw.println( (len / mm ) + 1);
        else mw.println(0);
    }

    static int gcd(int a, int b){
        if ( a==0 ) return b;
        return gcd ( b%a, a );
    }

    static int mcm(int a, int b){
        return (a * b ) / gcd(a,b);
    }

    static boolean powerOfTwo(int n){
        return Integer.numberOfTrailingZeros(n) == (String.valueOf(Integer.toBinaryString(n)).length() -1);
    }

    static int log2(int n){
        return (int) (Math.log(n) / Math.log(2));
    }
    static int min(int a,int b){
        return (a<b)?a : b;
    }
    static int max(int a,int b){
        return (a>b)?a : b;
    }

}

class Fraction{
    public int numb, denom;
    public Fraction(int n,int d){
        numb = n;
        denom = d;

        int g = gcd(n,d);
        n/=g;
        d/=g;
    }


    int gcd(int a,int b){
        if(b==0 )
            return a;
        if(a==0)
            return b;

        if(a== b)
            return a;

        if(a==1 || b == 1)
            return 1;

        return gcd(a, a%b);

    }

    public Fraction multiply(Fraction other){
        return new Fraction(numb*other.numb, denom * other.denom);
    }
    public Fraction divide(Fraction other){
        return multiply(new Fraction(other.denom, other.numb));
    }

}

class TrieNode{

    public char C;
    public boolean endOfWord;
    Vector<TrieNode> childs;
    public TrieNode(char c){
        this.C = c;
        endOfWord = false;
        childs = new Vector<TrieNode>();
    }

    // index of a son with a char

    public int SonIDX(char c){
        return childs.indexOf(new TrieNode(c));
    }

    @Override
    public String toString(){
        return String.format("%c",C);
    }

    public boolean equals(Object o){
        TrieNode node2 = (TrieNode)o;
        return node2.C == this.C;
    }
}



class MyScanner{
    BufferedReader br;
    StringTokenizer stk;
    public MyScanner(InputStream stream){
        this.br = new BufferedReader(new InputStreamReader(stream),72357);
        this.stk = new StringTokenizer("");
    }

    public MyScanner(FileReader fr){
        this.br = new BufferedReader(fr);
        this.stk = new StringTokenizer("");
    }

    public String next() throws IOException {
        while(!stk.hasMoreElements()){
            String line = br.readLine();
            if(line == null)
                return null;
            stk = new StringTokenizer(line);
        }
        return stk.nextToken();
    }

    public int nextInt()throws IOException{
        return Integer.parseInt(next());
    }

    public long nextLong() throws IOException{
        return Long.parseLong(next());
    }

    public double nextDouble() throws IOException{
        return Double.parseDouble(next());
    }

    public boolean canRead() throws IOException{
        return br.ready();
    }

    public int [] nextIntArray(int n) throws IOException{
        int arr[] = new int[n];
        for(int i=0;i<n;i++)
            arr[i] = nextInt();
        return arr;
    }

    public long [] nextLongArray(int n) throws IOException{
        long arr[] = new long[n];
        for(int i=0;i<n;i++)
            arr[i] = nextInt();
        return arr;
    }
}

class MyWriter{

    PrintWriter pw;
    public MyWriter(OutputStream out){
        this.pw = new PrintWriter(out);
    }

    public void print(Object obj){
        pw.print(obj.toString());
    }

    public void println(Object obj){
        pw.println(obj.toString());
    }

    public void printArray(int[] arr){
        for(int i=0;i<arr.length;i++){

            if(i==0)
                println(arr[i]);
            else println(" "+arr[i]);

        }
    }


    public void printVector(Vector<Integer> arr){
        for(int i=0;i<arr.size();i++){

            if(i==0)
                print(arr.elementAt(i));
            else print(" " + arr.elementAt(i));

        }
    }

    public void printIntMatrix(int [][] mt){
        for(int i=0;i<mt.length;i++){
            for(int j=0;j<mt[0].length;j++){
                print(mt[i][j]+" ");
            }
            println("");
        }
        println("");
    }
    public void close() {
        pw.close();
    }

}