#include <bits/stdc++.h>
using namespace std;
template <class T>
string toStr(const T &x) {
  stringstream s;
  s << x;
  return s.str();
}
template <class T>
int toInt(const T &x) {
  stringstream s;
  s << x;
  int r;
  s >> r;
  return r;
}
int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
int main() {
  int a, b;
  vector<int> v(4), vv;
  cin >> v[0] >> v[1] >> v[2] >> v[3] >> a >> b;
  sort(v.begin(), v.end());
  vv = v;
  int ans = 0;
  while (a <= b) {
    int cnt = 0;
    int tot = 0;
    do {
      int rez = (((a % v[0]) % v[1]) % v[2]) % v[3];
      if (rez == a) cnt++;
      tot++;
    } while (next_permutation(v.begin(), v.end()));
    if (cnt >= 7) ans++;
    v = vv;
    a++;
  }
  cout << ans;
  return 0;
}
