#include <iostream>
//#include <bits/stdc++.h>
//#include <algorithm>
#include <cmath>
//#include <iomanip>
//#include <string>
using namespace std;

int main(){

    double p,q,r,L,R,i,br=0; cin >> p >> q >> r >> L >> R;
    float a,b,c,zbr;
    for(i=L;i<=R;i++){
        a = ceil(i/p);
        b = ceil(i/q);
        c = ceil(i/r);
        zbr = a+b+c;
        if(zbr<=i){
            br++;
        }
    }
    cout << br;

    return 0;
}