using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main()
        {
            string s = Console.ReadLine();
            string[] s1 = s.Split(' ');
            
            
            double p=double.Parse(s1[0]);

            double q=double.Parse(s1[1]);

            double r=double.Parse(s1[2]);

            double L=double.Parse(s1[3]);

            double R=double.Parse(s1[4]);

            double br = 0;
            double brp, brq, brr;

            for (brp=p; brp <= R; brp += p)
            {
                for (brq = q; brq + brp <= R; brq += q)
                {
                    for (brr = r; brq + brp+ brr <= R; brr += r)
                    {
                        if (brp + brq + brr >= L)
                            br++;
                    }

                }
            }
           
            Console.Write(br);
          

        }
    }
}