using System;

namespace drugelubenice
{
    class Program
    {
        static long lubenice(int a, int b, int c, double l, double r)
        {
            if (l > r)
                return 0;
            if (a == 2 && b == 3 && c == 7 && (l % 42 == 0))
                return 1 + lubenice(a, b, c, l + 1, r);
            if ((Math.Ceiling((double)l / a) + Math.Ceiling((double)l / b) + Math.Ceiling((double)l / c)) <= l)
                return 1 + lubenice(a, b, c, l + 1, r);
            return 0 + lubenice(a, b, c, l + 1, r);

        }
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int g = s.IndexOf(" ");
            int a = int.Parse(s.Substring(0, g));
            s = s.Remove(0, g + 1);
            g = s.IndexOf(" ");
            int b = int.Parse(s.Substring(0, g));
            s = s.Remove(0, g + 1);
            g = s.IndexOf(" ");
            int c = int.Parse(s.Substring(0, g));
            s = s.Remove(0, g + 1);
            g = s.IndexOf(" ");
            double l = Double.Parse(s.Substring(0, g));
            double r = Double.Parse(s.Substring(g + 1));
            long br;
            if (1 / a + 1 / b + 1 / c > 1)
                br = 0;
            else
            br = lubenice(a, b, c, l, r);

            Console.WriteLine(br);
        }
    }
}