#include <bits/stdc++.h>
using namespace std;
int main() {
  int min, k, a, b;
  cin >> min;
  for (int i = 0; i < 3; i++) {
    cin >> k;
    if (k < min) min = k;
  }
  cin >> a >> b;
  if (min <= a)
    cout << 0;
  else if (b <= min) {
    cout << b - a + 1;
  } else {
    cout << min - a;
  }
}
