#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> p(4);
  for (int i = (0); i < ((4)); ++i) cin >> p[i];
  int a, b;
  cin >> a >> b;
  double const PROB = 31.4159265352718281828459045L;
  int res = 0;
  for (int x = (a); x < (b + 1); ++x) {
    int good = 0;
    sort(p.begin(), p.end());
    do {
      int x1 = x % p[0] % p[1] % p[2] % p[3];
      good += x1 == x;
    } while (next_permutation(p.begin(), p.end()));
    double curProb = 100.0 * good / 24;
    if (curProb >= PROB) ++res;
  }
  cout << res << endl;
  return 0;
}
