#include <bits/stdc++.h>
using namespace std;
bool check(long long x, long long p[]) {
  int cnt = 0;
  for (int i = 0; i < 4; ++i) {
    int a = i;
    for (int j = 0; j < 4; ++j) {
      if (j != a) {
        int b = j;
        for (int k = 0; k < 4; ++k) {
          if (k != b && k != a) {
            int c = k;
            for (int l = 0; l < 4; ++l) {
              if (l != c && l != a && l != b) {
                int d = l;
                if ((((x % p[a]) % p[b]) % p[c]) % p[d] == x) {
                  cnt++;
                }
              }
            }
          }
        }
      }
    }
  }
  return (cnt >= 7);
}
int main() {
  long long p[4], a, b, ans = 0;
  for (int i = 0; i < 4; i++) scanf("%lld", &p[i]);
  scanf("%lld", &a);
  scanf("%lld", &b);
  for (int i = (a); i <= (b); i++) {
    if (i == 0) {
      ans++;
    } else {
      if (check(i, p)) {
        ans++;
      }
    }
  }
  printf("%lld", ans);
  printf("\n");
  return 0;
}
