#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int L,R,p,q,r,i,b=0;
    double x,y,z;
    cin >> p >> q >> r >> L >> R;
    for(i=L;i<R;i++)
    {
        if(i%p!=0)
        x=i/p+1;
        x=i/p;
        if(i%q!=0)
        y=i/q+1;
        y=i/q;
        if(i%r!=0)
        z=i/r+1;
        z=i/r;
        if(x+y+z<=i)
        {
            b=b+1;
        }
    }
    cout << b;
    return 0;
}