#include <bits/stdc++.h>
using namespace std;
int a, b;
vector<int> p(4);
int main() {
  for (int& x : p) cin >> x;
  cin >> a >> b;
  int Ans = 0;
  for (int x = a; x <= b; x++) {
    int cnt = 0;
    sort(p.begin(), p.end());
    do {
      int y = x;
      for (auto Mod : p) y %= Mod;
      if (x == y) cnt++;
    } while (next_permutation(p.begin(), p.end()));
    if (cnt >= 7) Ans++;
  }
  cout << Ans;
}
