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