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

namespace kval32
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine();
            var data = line.Split(' ');
            int p = Convert.ToInt32(data[0]);
            int q = Convert.ToInt32(data[1]);
            int r = Convert.ToInt32(data[2]);
            long L = Convert.ToInt64(data[3]);
            long R = Convert.ToInt64(data[4]);

            long br = 0;
            
            for (long i = L; i <= R; i++)
            {
                if (Math.Ceiling(1.0 * i / p) + Math.Ceiling(1.0 * i / q) + Math.Ceiling(1.0 * i / r) <= i)
                    br++;
            }
            Console.WriteLine(br);
        }
    }
}