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

namespace Lubenice
{
    class Program
    {
        static void Main(string[] args)
        {
            var b = Console.ReadLine().Split();
            double p = double.Parse(b[0]);
            double q = double.Parse(b[1]);
            double r = double.Parse(b[2]);
            Int64 L = Int64.Parse(b[3]);
            Int64 R = Int64.Parse(b[4]);
            Int64 i, br = 0;
            for (i = L; i <= R; i++)
            {
                if(Math.Ceiling(i / p)+ Math.Ceiling(i / q)+ Math.Ceiling(i / r) <= i)
                {
                    br++;
                }
            }
            Console.WriteLine(br);
        }
    }
}