#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
int a, b;
int p[5];
int res = 0;
int retmod;
void read() {
  for (int i = 0; i < 4; ++i) {
    cin >> p[i];
  }
  cin >> a >> b;
}
int nRet(int x) {
  sort(p, p + 4);
  int ret = 0;
  do {
    retmod = (((x % p[0]) % p[1]) % p[2]) % p[3];
    if (retmod == x) ret++;
  } while (next_permutation(p, p + 4));
  return ret;
}
void init() {}
void solve() {
  int tmpcount = 0;
  for (int i = a; i <= b; ++i) {
    if (nRet(i) >= 7) {
      res++;
    }
  }
  cout << res;
}
int main() {
  read();
  init();
  solve();
}
