using System;

namespace Zadatak2Takm3
{
    class Program
    {
        static void Main(string[] args)
        {
            long p, q, r, lmax, rmax;
            string[] s = Console.ReadLine().Split();
            p = long.Parse(s[0]);
            q = long.Parse(s[1]);
            r = long.Parse(s[2]);
            lmax = long.Parse(s[3]);
            rmax = long.Parse(s[4]);
            int brojac = 0;
            decimal n = lmax;
            long br = 0, brp = 0, brq = 0, brr = 0;
            for (int i = 0; i < rmax - lmax + 1; i++)
            {
                brp = (long)Math.Ceiling(n / p);
                brq = (long)Math.Ceiling(n / q);
                brr = (long)Math.Ceiling(n / r);
                br = brp + brq + brr;
                if (br <= n)
                {
                    brojac++;
                }
                n++;
            }
            Console.WriteLine(brojac);
        }
    }
}