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

namespace ConsoleApp5
{
    class Program
    {
        static void Main(string[] args)
        {
            Decimal p, q, r, L, R, c = 0;
            string temp = Console.ReadLine();

            p= Convert.ToDecimal(temp.Split(' ')[0]);
            q = Convert.ToDecimal(temp.Split(' ')[1]);
            r = Convert.ToDecimal(temp.Split(' ')[2]);
            L = Convert.ToDecimal(temp.Split(' ')[3]);
            R = Convert.ToDecimal(temp.Split(' ')[4]);

            Decimal N = L;
            while (N <= R)
            {
                if ((Math.Ceiling(N / p) + Math.Ceiling(N / r) + Math.Ceiling(N / q)) <= N)
                {
                    ++c;
                }
                ++N;
            }
            Console.WriteLine(c);
        }
    }
}