#include <bits/stdc++.h>
int main() {
  int a, b, i, j, k = 0, mn = 1111, x, p[4];
  for (i = 0; i < 4; i++) {
    scanf("%d", &p[i]);
    if (p[i] < mn) mn = p[i];
  }
  scanf("%d%d", &a, &b);
  i = a;
  j = (b > mn - 1) ? mn - 1 : b;
  for (; i <= j; i++) k++;
  printf("%d", k);
  return 0;
}
