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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] x = Console.ReadLine().Split();
            int p = Convert.ToInt32(x[0]);
            int q = Convert.ToInt32(x[1]);
            int r = Convert.ToInt32(x[2]);
            int n = Convert.ToInt32(x[3]);
            int m = Convert.ToInt32(x[4]);
            int l = 0;
            for (double i = n; i <= m; i++)
            {
                if (Math.Ceiling(i / p) + Math.Ceiling(i / q) + Math.Ceiling(i / r) <= i)
                {
                    l++;
                }
            }
            Console.WriteLine(l);
            Console.ReadLine();
        }
    }
}