using System;

namespace ConsoleApplication1
{
    class Program
    {

        static int round(double a, double b) 
        {
            int val;
            if ((a % b) != 0)
                val = (int)((a / b) + 1);
            else
                val = (int)(a / b);
            return val;
        }

        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 L1=L;
            if (p + q + r > L)
                L1 = p + q + r;


            for (double i = L1; i <= R; i++)
            {
                if (round(i, p) + round(i, q) + round(i, r) <= i)
                { br++; }
            
            
            }

                Console.Write(br);
                

        }
    }
}