#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  int c[4];
  int minC = INT_MAX;
  for (int i = 0; i < 4; i++) {
    cin >> c[i];
    if (minC > c[i]) minC = c[i];
  }
  cin >> a >> b;
  int minXX = min(minC, b);
  int ans = minXX - a;
  bool baal = 0;
  if (minXX != minC) baal = 1;
  if (ans < 0)
    cout << 0 << endl;
  else if (a == b && minC > a)
    cout << 1 << endl;
  else if (baal == 1)
    cout << ans + 1 << endl;
  else
    cout << ans << endl;
  return 0;
}
