#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int p[4];
  int a, b;
  for (int &i : p) cin >> i;
  cin >> a >> b;
  int c = 0;
  for (int i = a; i <= b; ++i) {
    int d = 0;
    for (int w = 0; w < 4; ++w)
      for (int x = 0; x < 4; ++x)
        for (int y = 0; y < 4; ++y)
          for (int z = 0; z < 4; ++z)
            d += w != x && w != y && w != z && x != y && x != z && y != z &&
                 i % p[w] % p[x] % p[y] % p[z] == i;
    c += d >= 7;
  }
  cout << c;
  return 0;
}
