using System;

namespace Lubenice
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] unos = Console.ReadLine().Split(' ');
            long p = (long)Math.Ceiling(double.Parse(unos[0]));
            long q = (long)Math.Ceiling(double.Parse(unos[1]));
            long r = (long)Math.Ceiling(double.Parse(unos[2]));
            long L = (long)Math.Ceiling(double.Parse(unos[3]));
            long R = (long)Math.Ceiling(double.Parse(unos[4]));
            long i = L;
            long br = 0;
            while(i <= R)
            {
                if((i % p == 0 && i % q == 0) || (i % p == 0 && i % r == 0) || (i % q == 0 && i % r == 0))
                {
                    br++;
                }
                i++;
            }
            
            Console.WriteLine(br);
            Console.ReadKey();
        }
    }
}