using System;

class TakZad2 {
    static void Main(){
        string s = Console.ReadLine();
        string[] str1 = s.Split(null);
            double p = double.Parse(str1[0]);
            double q = double.Parse(str1[1]);
            double r = double.Parse(str1[2]);
            long L = Convert.ToInt64(str1[3]);
            long R = Convert.ToInt64(str1[4]);
        long lub = 0;
            for(long N = L; N <= R; N += 1){
                if (N <= 100){
                    long iz = Convert.ToInt64(Math.Ceiling(N/p) + Math.Ceiling(N/q) + Math.Ceiling(N/r));
                    if(iz <= N){
                    lub += 1;
                    }
                }
                else{
                    lub+= R-100;
                    break;
                }
            }
        Console.Write(lub);
    }
}