#include <bits/stdc++.h>
using namespace std;
int a, b, x, res = 1111;
int main() {
  for (int i = 1; i <= 4; i++) cin >> x, res = min(res, x);
  cin >> a >> b;
  if (res < a)
    cout << 0;
  else if (res > b)
    cout << b - a + 1;
  else
    cout << res - a;
  return 0;
}
