#include <bits/stdc++.h>
using namespace std;
int p1, p2, p3, p4, a, b;
int main() {
  cin >> p1 >> p2 >> p3 >> p4 >> a >> b;
  int ans = 0;
  int p = min(p1, p2);
  p = min(p, p3);
  p = min(p, p4);
  if (b < p) {
    cout << b - a + 1 << "\n";
    return 0;
  }
  if (p - a > 0) {
    ans = p - a;
  }
  cout << ans << "\n";
  return 0;
}
