using System;
class Program {
    static void Main() {
        string s = Console.ReadLine();
        string[] a = s.Split(null);
        double p = double.Parse(a[0]);
        double q = double.Parse(a[1]);
        double r = double.Parse(a[2]);
        long L = Convert.ToInt64(a[3]);
        long R = Convert.ToInt64(a[4]);
        long br = 0;
        if(q == 1 || p == 1 || r == 1) {}
        else if((q == 2 && p == 2)||(p == 2 && r == 2)||(q == 2 && r == 2)) {}
        else if(q == 3 && p == 3 && r == 3) {}
        else {
            for(long n = L; n <= R; n += 1) {
                if(n <= 100) {
                    long A = Convert.ToInt64(Math.Ceiling(n/p) + Math.Ceiling(n/q) + Math.Ceiling(n/r));
                    if(A <= n) { br++; }
                }
                else { 
                    br += R - 100;
                    break;
                }
            }
        }
        Console.WriteLine(br);
    }
}