#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int p1, p2, p3, p4, a, b;
  cin >> p1 >> p2 >> p3 >> p4 >> a >> b;
  int min = p1 < p2 ? p1 : p2;
  min = min < p3 ? min : p3;
  min = min < p4 ? min : p4;
  if (b < min) {
    cout << (b - a + 1);
    return 0;
  }
  int res = min - a;
  cout << (res < 0 ? 0 : res);
  return 0;
}
