#include <iostream>
#include <bits/stdc++.h>
using namespace std;

long long int zaokruzi(long long int L, int p){
    if(float(L)/float(p) > L/p)
        return L/p+1;
    }
int main()
{
    long long int L, R, N, br = 0;
    int p, q, r;
    cin >> p >> q >> r >> L >> R;

    for(N = L; N <= R; N++){
        if(zaokruzi(N, p) + zaokruzi(N, q) + zaokruzi(N, r) <= N)
            br++;
    }
    cout << br;

    return 0;
}