using System;
					
public class Program
{
	public static void Main()
	{
			string[] ulaz = Console.ReadLine().Split( );
            float p = float.Parse(ulaz[0]);
            float q = float.Parse(ulaz[1]);
            float r = float.Parse(ulaz[2]);
            long pocetak = Convert.ToInt64(ulaz[3]);
            long kraj= Convert.ToInt64(ulaz[4]);
            long izlaz = 0;
            long killstreak = 0;
            for(long i = pocetak; i<=kraj;i++)
            {
                
                if (killstreak > 100)
                {
                    izlaz = izlaz + kraj - i +1;
                    goto Finish;
                    
                }
                else
                {
                    if (Math.Ceiling(i / p) + Math.Ceiling(i / q) + Math.Ceiling(i / r) <= i)
                    {
                        izlaz = izlaz + 1;
                        killstreak = killstreak + 1;
                    }
                    else killstreak = 0;
                }
            }
            Finish:
            Console.WriteLine(izlaz);
	}
}