#include <iostream>
#include <math.h>
using namespace std;

int main()
{
    int p, q, r;
    long long s, t, OYEA=0;
    cin>>p>>q>>r>>s>>t;
    for(double N=s; N<=t; N++) if(ceil(N/p)+ceil(N/q)+ceil(N/r)<=N) OYEA++;
    cout<<OYEA;
    return 0;
}