using System;

namespace ConsoleApp8
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int p = int.Parse(s.Substring(0, s.IndexOf(" ")));
            s = s.Substring(s.IndexOf(" ") + 1);
            int q = int.Parse(s.Substring(0, s.IndexOf(" ")));
            s = s.Substring(s.IndexOf(" ") + 1);
            int r = int.Parse(s.Substring(0, s.IndexOf(" ")));
            s = s.Substring(s.IndexOf(" ") + 1);
            double L = Convert.ToDouble(s.Substring(0, s.IndexOf(" ")));
            s = s.Substring(s.IndexOf(" ") + 1);
            double R = Convert.ToDouble(s); long br = 0;
            while (L<=R)
            {
                if ((Math.Ceiling(L/p)+ Math.Ceiling(L / q)+ Math.Ceiling(L / r))<=L)
                {
                    br+=1;
                }
                L+=1;
            }
            

            Console.WriteLine(br);
            

        }

    }
}