#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a;
  for (int i = 0; i < 4; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  int l, r;
  cin >> l >> r;
  int cc = 0;
  for (int i = l; i <= r; i++) {
    int c = 0;
    sort((a).begin(), (a).end());
    do {
      int m = i;
      for (int j = 0; j < 4; j++) {
        m %= a[j];
      }
      if (m == i) c++;
    } while (next_permutation((a).begin(), (a).end()));
    if (c > 6) cc++;
  }
  cout << cc;
  return 0;
}
