#include <bits/stdc++.h>
using namespace std;
int main() {
  int p[4], a, b;
  cin >> p[0];
  cin >> p[1];
  cin >> p[2];
  cin >> p[3];
  cin >> a;
  cin >> b;
  int min = p[0];
  for (int i = 1; i < 4; i++)
    if (min > p[i]) min = p[i];
  int count = ((a < min) ? (min - a) : 0);
  count = ((count > (b - a + 1)) ? (b - a + 1) : count);
  cout << count << endl;
}
