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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            double p = Convert.ToDouble(s[0]);
            double q = Convert.ToDouble(s[1]);
            double r = Convert.ToDouble(s[2]);
            double L = Convert.ToDouble(s[3]);
            double R = Convert.ToDouble(s[4]);
            int br=0;
            while(L<=R)
            {
                if (Math.Ceiling(L / p) + Math.Ceiling(L / q) + Math.Ceiling(L / r) <= L)
                    br++;
                L++;
            }
            Console.WriteLine(br);
        }
    }
}