#include <iostream>
using namespace std;
int main() 
{
    int p, q, r, L, R, i, xp, xq, xr, n;
    cin >> p >> q >> r >> L >> R;
    n=0;
    for(i=L;i<=R;i++)
    {
        xp = (i/p) + 1;
        xq = (i/q) + 1;
        xr = (i/r) + 1;
        if(xp+xq+xr<=i) n=n+1;
    }
    cout << n << endl;
    return (0);
}