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