#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
int main() {
  int p[4], a, b;
  for (int i = 0; i < (int)4; ++i) cin >> p[i];
  cin >> a >> b;
  int ans = 0;
  for (int i = a; i <= b; ++i) {
    sort(p, p + 4);
    do {
      int x = i;
      for (int j = 0; j < (int)4; ++j) {
        x %= p[j];
      }
      if (x == i) {
        ans++;
        break;
      }
    } while (next_permutation(p, p + 4));
  }
  cout << ans << endl;
}
