using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lubence
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();

            double p = Convert.ToSingle(s[0]);
            double q = Convert.ToSingle(s[1]);
            double r = Convert.ToSingle(s[2]);
            ulong L = Convert.ToUInt64(s[3]);
            ulong R = Convert.ToUInt64(s[4]);

            ulong br=0;

            for (ulong i = L; i <= R; i++)
            {
                if (zaokruzi(Convert.ToDouble(i) / p)+ zaokruzi(Convert.ToDouble(i) / q) +zaokruzi(Convert.ToDouble(i) / r) <= i)
                {
                    br++;
                }
            }

            Console.WriteLine(Convert.ToString(br));


        }

        static ulong zaokruzi(Double a)
        {
            ulong c = Convert.ToUInt64(a * 10);

            if (c%10>0)
            {
                c = c / 10 + 1;
            }
            else
            {
                c = c / 10;
            }
            return c;
        }
    }
}