#include <iostream>
#include <math.h>

using namespace std;

unsigned long long roundd(double n){
  if (n - ((unsigned long long)n) == 0) return n;
  return n + 1;
}

int main(){
  
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  double p, q, r;
  unsigned long long counter = 0, L, R;

  cin >> p >> q >> r >> L >> R;

  R = R + 1;

  for (unsigned long long n = L; n < R; ++n){
    if ( (roundd(n / p) + roundd(n / q) + roundd(n / r)) <= n ){
      counter++;
    }
  }

  cout << counter << endl;

  return 0;
}