#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  vector<int> v(4);
  int a, b;
  for (int i = 0; i < 4; i++) cin >> v[i];
  cin >> a >> b;
  sort(v.begin(), v.end());
  map<int, int> m;
  do {
    for (int i = a; i <= b; i++) {
      int x = i;
      for (int j = 0; j < 4; j++) x = x % v[j];
      if (i == x) m[i]++;
    }
  } while (next_permutation(v.begin(), v.end()));
  int ret = 0;
  for (map<int, int>::const_iterator it = m.begin(); it != m.end(); ++it)
    if (it->second >= 7) ret++;
  cout << ret << endl;
  return 0;
}
