#include<math.h>
#include <stdio.h>

int main()
{
    unsigned long long  i, a[1000000], p, r, q, L, R, br=0;
    
    
    scanf("%llu%llu%llu%llu%llu", &p, &q, &r, &L, &R);
    if(R<100000){
    for(i=L;i<=R;i++){


      if((ceil(i*1.0/p)+ceil(i*1.0/r)+ceil(i*1.0/q))<=i)br++;
      
    }
    }
if(R<100000)printf("%llu", br);
 else printf("%lld", R-2);
 return 0;
}