#include <bits/stdc++.h>
using namespace std;
int a[10];
int gao(int x) {
  sort(a, a + 4);
  int flag = 0;
  int ans = x;
  do {
    ans = x;
    for (int i = 0; i < 4; i++) ans = ans % a[i];
    if (ans == x) flag++;
  } while (next_permutation(a, a + 4));
  if (flag >= 7) return 1;
  return 0;
}
int main() {
  int x, y;
  for (int i = 0; i < 4; i++) cin >> a[i];
  cin >> x >> y;
  int sum = 0;
  for (int i = x; i <= y; i++) {
    if (gao(i)) sum++;
  }
  cout << sum << endl;
  return 0;
}
