#include <bits/stdc++.h>
using namespace std;
long long int i, j, temp, k, x;
long long int mx, mn;
long long int tempa, tempb;
long long int flag = 0;
int main() {
  long long int t;
  t = 1;
  while (t--) {
    long long int n, ct = 0;
    long long int lo, up;
    vector<long long int> p;
    for (i = 0; i < 4; i++) {
      cin >> temp;
      p.push_back(temp);
    }
    sort(p.begin(), p.end());
    cin >> lo >> up;
    if (lo >= p[0]) {
      cout << 0 << endl;
    } else if (up < p[0])
      cout << up - lo + 1 << endl;
    else {
      cout << p[0] - lo << endl;
    }
  }
  return 0;
}
