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