Problem: 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. 

Solution (in JAVA):

Solution:
import java.awt.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.StringTokenizer;

import static java.lang.Math.max;

public class Main implements Runnable {
    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    final Scanner in;
    Writer out;
    long timeBegin, timeEnd;

    public Main() throws FileNotFoundException {
        Locale.setDefault(Locale.US);
        if (ONLINE_JUDGE) {
            in = new Scanner(new InputStreamReader(System.in));
            out = new Writer(System.out);
        } else {
            in = new Scanner(new FileReader("input.txt"));
            //out = new Writer("output.txt");
            out = new Writer(System.out);
        }
    }

    public static void main(String[] args) throws FileNotFoundException {
        new Thread(null, new Main(), "", 128 * (1L << 20)).start();
    }

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time: " + (timeEnd - timeBegin) + "ms");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            solve();
            out.close();
            time();
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }

    void solve() throws IOException, ParseException {
        int[] f = in.nextIntArray(4);
        BigInteger x = BigInteger.valueOf(f[0]);
        BigInteger y = BigInteger.valueOf(f[1]);
        int lcm = x.multiply(y).divide(x.gcd(y)).intValue();
        out.println(f[3] / lcm - (f[2] - 1) / lcm);
    }
}

class Scanner {
    BufferedReader in;
    StringTokenizer stringTokenizer;

    public Scanner(InputStreamReader inputStreamReader) throws FileNotFoundException {
        in = new BufferedReader(inputStreamReader);
    }

    String next() {
        while (stringTokenizer == null || !stringTokenizer.hasMoreElements()) {
            try {
                stringTokenizer = new StringTokenizer(in.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return stringTokenizer.nextToken();
    }

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

    int[] nextIntArray(int size) throws IOException {
        int[] array = new int[size];
        for (int index = 0; index < size; ++index) {
            array[index] = nextInt();
        }
        return array;
    }

    ArrayList<Integer> nextIntArrayList(int size) {
        ArrayList<Integer> result = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            result.add(nextInt());
        }
        return result;
    }

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

    long[] readLongArray(int size) throws IOException {
        long[] array = new long[size];
        for (int index = 0; index < size; ++index) {
            array[index] = nextLong();
        }
        return array;
    }

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

    double[] readDoubleArray(int size) throws IOException {
        double[] array = new double[size];

        for (int index = 0; index < size; ++index) {
            array[index] = nextDouble();
        }

        return array;
    }

    char nextChar() throws IOException {
        int intValue = in.read();
        while (intValue == 10 || intValue == 13) {
            intValue = in.read();
        }
        if (intValue == -1) {
            return '\0';
        }
        return (char) intValue;
    }

    char[] readCharArray() throws IOException {
        return nextLine().toCharArray();
    }

    BigInteger readBigInteger() throws IOException {
        return new BigInteger(next());
    }

    BigDecimal readBigDecimal() throws IOException {
        return new BigDecimal(next());
    }

    Point nextPoint() throws IOException {
        int x = nextInt(), y = nextInt();
        return new Point(x, y);
    }

    Point[] nextPointArray(int size) throws IOException {
        Point[] array = new Point[size];

        for (int index = 0; index < size; ++index) {
            array[index] = nextPoint();
        }

        return array;
    }

    List<Integer>[] readGraph(int vertexNumber, int edgeNumber) throws IOException {
        @SuppressWarnings("unchecked")
        List<Integer>[] graph = new List[vertexNumber];

        for (int index = 0; index < vertexNumber; ++index) {
            graph[index] = new ArrayList<>();
        }

        while (edgeNumber-- > 0) {
            int from = nextInt() - 1;
            int to = nextInt() - 1;

            graph[from].add(to);
            graph[to].add(from);
        }

        return graph;
    }


    String nextLine() {
        String str = "";
        try {
            str = in.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}

class Writer extends PrintWriter {
    final int DEFAULT_PRECISION = 12;

    int precision;
    String format, formatWithSpace;

    {
        precision = DEFAULT_PRECISION;

        format = createFormat(precision);
        formatWithSpace = format + " ";
    }

    public Writer(OutputStream out) {
        super(out);
    }

    public Writer(String fileName) throws FileNotFoundException {
        super(fileName);
    }

    public int getPrecision() {
        return precision;
    }

    public void setPrecision(int precision) {
        precision = max(0, precision);
        this.precision = precision;

        format = createFormat(precision);
        formatWithSpace = format + " ";
    }

    public <T> void printMany(List<T> list) {
        for (T element : list) {
            print(element);
            print(" ");
        }
    }

    public void printArray(int[] a) {
        for (int element : a) {
            print(element);
            print(" ");
        }
    }

    private String createFormat(int precision) {
        return "%." + precision + "f";
    }

    @Override
    public void print(double d) {
        printf(format, d);
    }

    public void printWithSpace(double d) {
        printf(formatWithSpace, d);
    }

    public void printAll(double... d) {
        for (int i = 0; i < d.length - 1; ++i) {
            printWithSpace(d[i]);
        }

        print(d[d.length - 1]);
    }

    @Override
    public void println(double d) {
        printlnAll(d);
    }

    public void printlnAll(double... d) {
        printAll(d);
        println();
    }
}