#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

vector<long long>interval;
int main() {
  double p,q,r,L,R;
  double Np,Nq,Nr;
  int ukupno=0;
  cin>>p>>q>>r>>L>>R;
  int razlika = (R-L)+1;
  for(int i = 0;i<razlika;i++){
    int k = L+i;
    interval.push_back(k);
  }
  for(int i = 0;i<razlika;i++){
    Np = ceil(double(interval[i])/p);
    Nq = ceil(double(interval[i])/q);
    Nr = ceil(double(interval[i])/r);
    if(int(Np+Nq+Nr)<=interval[i]){
      ukupno ++;
    }
  }
  cout<<ukupno;
}