#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> tmp(4);
  cin >> tmp[0] >> tmp[1] >> tmp[2] >> tmp[3];
  sort(tmp.begin(), tmp.end());
  vector<vector<int>> P;
  do {
    P.push_back(tmp);
  } while (next_permutation(tmp.begin(), tmp.end()));
  int a, b;
  cin >> a >> b;
  int res = 0;
  for (int i = a; i <= b; i++) {
    int cnt = 0;
    for (int j = 0; j < P.size(); j++)
      if (i % P[j][0] % P[j][1] % P[j][2] % P[j][3] == i) cnt++;
    if (cnt >= 7) res++;
  }
  cout << res;
  return 0;
}
