#include <bits/stdc++.h>
using namespace std;
bool perebor(int a, int b, int c, int d, int z) {
  bool flag = false;
  if (z < min(a, min(b, min(c, d)))) flag = true;
  return flag;
}
int main() {
  int a, b, c, d;
  int low, high;
  cin >> a >> b >> c >> d >> low >> high;
  int i, count = 0;
  for (i = low; i <= high; i++) {
    bool flag = perebor(a, b, c, d, i);
    if (flag) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
