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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            double p = double.Parse(s[0]);
            double q = double.Parse(s[1]);
            double r = double.Parse(s[2]);
            double L = double.Parse(s[3]);
            double R = double.Parse(s[4]);
            double p1, q1, r1;
            double z = 0;
            double N=L;
            while(N<=R)
            {
                p1 = Math.Ceiling(N / p);
                q1 = Math.Ceiling(N / q);
                r1 = Math.Ceiling(N / r);
                if (p1+q1+r1<=N)
                {
                    z++;
                }
                N++;
            }
            Console.WriteLine(""+z);
            Console.ReadKey();
        }
    }
}