using System;

namespace Upoznavanje
{
    public class Program
    {
        static int zaokruzi(double x)
        {
            double n;
            n = Math.Round(x);
            if (n < x) return (int)n + 1;
            else return (int)n;
        }
        public static void Main(string[] args)
        {
            string s;
            string[] a;
            
            s = Console.ReadLine();
            a = s.Split();
            double br = 0;
            double p = double.Parse(a[0]);
            double q = double.Parse(a[1]);
            double r = double.Parse(a[2]);
            double L = double.Parse(a[3]);
            double R = double.Parse(a[4]);


            for (double i = L; i <= R; i++)
            {
                if ((zaokruzi(i / p) + zaokruzi(i / q) + zaokruzi(i / r)) <= i) br++;

            }
            
            Console.WriteLine(br);
           

        }
    }
}