#include <bits/stdc++.h>
using namespace std;
int p[5];
int a, b;
inline bool f(int x, int p1, int p2, int p3, int p4) {
  return ((((x % p1) % p2) % p3) % p4) == x;
}
int main() {
  for (int i = 0; i < 4; ++i) {
    cin >> p[i];
  }
  cin >> a >> b;
  int ans = 0;
  for (int i = a; i <= b; ++i) {
    sort(p, p + 4);
    int cur = 0;
    do {
      if (f(i, p[0], p[1], p[2], p[3])) {
        ++cur;
        if (cur == 7) {
          ++ans;
          break;
        }
      }
    } while (next_permutation(p, p + 4));
  }
  cout << ans << endl;
  return 0;
}
