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