#include <iostream>
#include <math.h>
using namespace std;
long Funkcija(short a, short b, short c, double l, long 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 ((ceil(1/a) + ceil(1/b) + ceil(1/c)) <= l)
        return 1 + lubenice(a, b, c, l + 1, r);
    return 0 + lubenice(a, b, c, l + 1, r);

}
main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    long r,l;
    short a,b,c;
    cin>>a>>b>>c>>l>>r;
    long long int br = Funkcija(a, b, c, l, r);
    cout<<a<<b<<c<<l<<r<<endl;
    cout<<br;
}