#include <bits/stdc++.h>
using namespace std;
void m1() {
  int p[4], a, b;
  cin >> p[0] >> p[1] >> p[2] >> p[3] >> a >> b;
  int m = min(min(p[0], p[1]), min(p[2], p[3]));
  int ans = 0;
  for (int i = a; i <= b; ++i) {
    if (i < m) ++ans;
  }
  cout << ans;
}
int main() { m1(); }
