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