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