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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            double p = double.Parse(s[0]);
            double q = double.Parse(s[1]);
            double r = double.Parse(s[2]);
            ulong L = ulong.Parse(s[3]);
            ulong R = ulong.Parse(s[4]);
            double z = 0;
            while(L<=R)
            {
                if (Math.Ceiling(L / p) + Math.Ceiling(L / q) + Math.Ceiling(L / r) <= L)
                {
                    z++;
                }
                L++;
            }
            Console.WriteLine(""+z);
            Console.ReadKey();
        }
    }
}