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