#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
int num[32000];
inline int evaluate(int x, vector<int> mod) {
  for (int i = (0); i < (int((mod).size())); ++i) x = x % mod[i];
  return x;
}
int main() {
  vector<int> perm(4);
  int a, b;
  for (int i = (0); i < (4); ++i) cin >> perm[i];
  cin >> a >> b;
  sort((perm).begin(), (perm).end());
  do {
    for (int i = (a); i < (b + 1); ++i)
      if (evaluate(i, perm) == i) num[i]++;
  } while (next_permutation((perm).begin(), (perm).end()));
  int ANSWER = 0;
  for (int i = (a); i < (b + 1); ++i)
    if (num[i] > 6) ANSWER++;
  cout << ANSWER << endl;
  return 0;
}
