#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int p;
  int minp = 1000;
  for (int i = 0; i < 4; i++) {
    cin >> p;
    minp = min(p, minp);
  }
  int a, b;
  cin >> a >> b;
  if (b < minp) {
    cout << b - a + 1;
  } else if (b >= minp && a <= minp) {
    cout << minp - a;
  } else {
    cout << 0;
  }
}
