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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string str1 = Console.ReadLine();
            string[] niz1 = str1.Split();
            int p = int.Parse(niz1[0]);
            int q = int.Parse(niz1[1]);
            int r = int.Parse(niz1[2]);
            long L = Convert.ToInt64(niz1[3]);
            long M = Convert.ToInt64(niz1[4]);
            if (L > M)
            {
                long temp = L;
                L = M;
                M = temp;
            }
            double sum = 0;
            double k = 0;
            for (long i = L; i <= M; i++)
            {
                double m = i / p;
                if (i % m != 0)
                    m++;
                double n = i / q;
                if (i % q != 0)
                    n++;
                double t = i / r;
                if (i % r != 0)
                    t++;
                sum = m + n + t;
                if (sum <= i)
                    k++;
            }
            Console.WriteLine(k);
        }
    }
}