#include <bits/stdc++.h>
using namespace std;
int mod(int x, int p1, int p2, int p3, int p4) {
  if ((((x % p1) % p2) % p3) % p4 == x) {
    return 1;
  } else
    return 0;
}
int main() {
  int arr[4], n, m, counter = 0, c2 = 0;
  for (int i = 0; i < 4; i++) {
    scanf("%d", &arr[i]);
  }
  scanf("%d %d", &n, &m);
  for (int i = n; i <= m; i++) {
    for (int j = 0; j < 4; j++) {
      for (int k = 0; k < 4; k++) {
        for (int l = 0; l < 4; l++) {
          for (int p = 0; p < 4; p++) {
            if (arr[j] != arr[k] && arr[k] != arr[l] && arr[l] != arr[p] &&
                arr[p] != arr[j] && arr[p] != arr[k] && arr[l] != arr[j]) {
              if (mod(i, arr[j], arr[k], arr[l], arr[p])) {
                counter++;
              }
            }
          }
        }
      }
    }
    if (counter >= 7) c2++;
    counter = 0;
  }
  cout << c2 << endl;
  return 0;
}
