#include <bits/stdc++.h>
using namespace std;
int p[4];
int a, b;
bool used[4];
int per[4];
int v;
int cnt;
int ccnt;
bool eval() {
  int val = v;
  for (int i = 0; i < 4; ++i) {
    val %= p[per[i]];
  }
  if (val == v) {
    ++ccnt;
    if (ccnt >= 7) {
      ++cnt;
    }
  }
}
void perm(int k) {
  if (ccnt >= 7) return;
  if (k == 4) {
    eval();
    if (ccnt >= 7) return;
  }
  for (int i = 0; i < 4; ++i) {
    if (used[i]) continue;
    used[i] = true;
    per[k] = i;
    perm(k + 1);
    used[i] = false;
  }
}
int main() {
  for (int i = 0; i < 4; ++i) {
    cin >> p[i];
    used[i] = false;
  }
  cin >> a >> b;
  cnt = 0;
  for (v = a; v <= b; ++v) {
    ccnt = 0;
    perm(0);
  }
  cout << cnt << endl;
  return 0;
}
