#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  int arr[4];
  for (int i = 0; i < 4; i++) cin >> arr[i];
  int a, b;
  cin >> a >> b;
  sort(arr, arr + 4);
  if (arr[0] > b)
    cout << b - a + 1 << endl;
  else if (arr[0] > a)
    cout << arr[0] - a << endl;
  else
    cout << 0 << endl;
  return 0;
}
