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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Int64 b = 0;
            string x = Console.ReadLine();
            double p = Convert.ToInt64(x.Split(' ')[0]);
            double q = Convert.ToInt64(x.Split(' ')[1]);
            double r = Convert.ToInt64(x.Split(' ')[2]);
            Int64 L = Convert.ToInt64(x.Split(' ')[3]);
            Int64 R = Convert.ToInt64(x.Split(' ')[4]);
            Int64 N;
            for (N = L; N <= R; N++)
                if (Math.Ceiling(N / p) + Math.Ceiling(N / q) + Math.Ceiling(N / r) <= N)
                {
                    b++;
                    
                }
            Console.WriteLine(b);
            Console.Read();              
        }
    }
}