using System;
using System.Linq;

namespace petlja
{
	class Program
	{
		static void Main(string[] args)
		{
			
			string[] unos = Console.ReadLine().Split();
			int a = int.Parse(unos[0]);
			int b = int.Parse(unos[1]);
			int c = int.Parse(unos[2]);
		    int min = int.Parse(unos[3]);
			int max = int.Parse(unos[4]);

			int n = 0;
			for (int i = min; i <= max; i++)
			{
				double x = Math.Ceiling((double)i / a);
				double y = Math.Ceiling((double)i / b);
				double z = Math.Ceiling((double)i / c);

				if (x + y + z <= i)
				{
					n++;
					//Console.WriteLine("{0} {1} {2}   {3}", x, y, z, i);
				}
			}
			Console.WriteLine(n);
		}
		
	}
}