using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string e = Console.ReadLine();
            string[] st = e.Split();
            double p = Convert.ToDouble(st[0]), q = Convert.ToDouble(st[1]), r = Convert.ToDouble(st[2]);
            ulong L = Convert.ToUInt64(st[3]), R = Convert.ToUInt64(st[4]);
            double pr = 0, dr = 0, tr = 0; ulong N = 0;
            for (ulong i = L; i <= R; i++)
            {
                pr = i / p; dr = i / q; tr = i / r;
                pr = Math.Ceiling(pr); dr = Math.Ceiling(dr); tr = Math.Ceiling(tr);
                if (pr + dr + tr <= i) N++;
            }
            Console.WriteLine(N);
        }
    }
}