#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++)
    {
        if(i%p != 0) xp = (i/p) + 1;
        if(i%q != 0) xq = (i/q) + 1;
        if(i%r != 0) xr = (i/r) + 1;
        if(i%p == 0) xp = i/p;
        if(i%q == 0) xq = i/q;
        if(i%r == 0) xr = i/r;        
        if(xp+xq+xr<=i) n=n+1;
    }
    cout << n << endl;
    return (0);
}