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

namespace Zadatak2512020br2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] line1 = Console.ReadLine().Split(' ');
            byte p = Convert.ToByte(line1[0]);
            byte q = Convert.ToByte(line1[1]);
            byte r = Convert.ToByte(line1[2]);
            long donja_granica = Convert.ToInt64(line1[3]);
            long gornja_granica = Convert.ToInt64(line1[4]);
            long brojac = 0;
            for (long i = donja_granica; i <= gornja_granica; i++)
            {
                long suma = 0;
                if (i % p != 0) suma+=1;
                if (i % q != 0) suma+=1;
                if (i % r != 0) suma+=1;
                if (i/p+i/q+i/r + suma <= i) brojac++;
            }
            Console.WriteLine(brojac);
            Console.ReadKey();
        }
    }
}