#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
double p,q,r;
double a,b;
cin>>p>>q>>r>>a>>b;
int nzs=p*q*r+100;
unsigned long long brojac=b-nzs;
double jedanq = 1/q;
double jedanp = 1/p;
double jedanr = 1/r;


double jedanzbir = jedanq+jedanp+jedanr;

if(jedanzbir>1){
    cout<<"0";
    return 0;
}
if(nzs>b){
        nzs=b;
        brojac=0;
}
if(nzs<a){
    cout<<b-a+1;
    return 0;
}
for(double i=a;i<=nzs;i++){
        if(i==1) continue;
        if(i==2) continue;
        double prvi = ceil(i/p);
        double drugi = ceil(i/q);
        double treci = ceil(i/r);
        double provera = prvi+drugi+treci;
        if(provera<=i) {brojac++; }
}

cout<<brojac;
return 0;




}