using System;

namespace petljazad2
{
    class Program
    {
        static void Main(string[] args)
        {
            string input1 = Console.ReadLine();
            Int64 p = Convert.ToInt64(input1.Substring(0, input1.IndexOf(" ")));
            input1 = input1.Substring(input1.IndexOf(" ") + 1);
            Int64 q = Convert.ToInt64(input1.Substring(0, input1.IndexOf(" ")));
            input1 = input1.Substring(input1.IndexOf(" ") + 1);
            Int64 r = Convert.ToInt64(input1.Substring(0, input1.IndexOf(" ")));
            input1 = input1.Substring(input1.IndexOf(" ") + 1);
            Int64 L = Convert.ToInt64(input1.Substring(0, input1.IndexOf(" ")));
            input1 = input1.Substring(input1.IndexOf(" ") + 1);
            Int64 R = Convert.ToInt64(input1);
            Int64 np;
            Int64 nq;
            Int64 nr;
            Int64 br = 0;
            for (Int64 n = L; n <= R; n++)
            {
                if (n % p == 0)
                {
                    np = n / p;
                }
                else
                { 
                    np = (n / p) + 1;
                }
                if (n % q == 0)
                {
                    nq = n / q;
                }
                else
                {
                    nq = (n / q) + 1;
                }
                if (n % r == 0)
                {
                    nr = n / r;
                }
                else
                {
                    nr = (n / r) + 1;
                }
                if(np + nq + nr <= n)
                {
                    br++;
                }
            }

            Console.WriteLine(br);
        }
    }
}