#include <bits/stdc++.h>
using namespace std;
const int maxn = 31420;
int c[maxn] = {0};
int main() {
  ios::sync_with_stdio(false);
  int ans = 0;
  int a, b;
  int fx;
  int p[5];
  for (int i = 0; i < 4; ++i) scanf("%d", &p[i]);
  sort(p, p + 4);
  scanf("%d %d", &a, &b);
  do {
    for (int x = a; x < b + 1; ++x) {
      fx = ((((x % p[0]) % p[1]) % p[2]) % p[3]);
      if (fx == x) ++c[x];
    }
  } while (next_permutation(p, p + 4));
  for (int x = a; x < b + 1; ++x)
    if (c[x] >= 7) ++ans;
  printf("%d\n", ans);
  return 0;
}
