import java.util.Scanner;

public class Lubenice {

    public static void main(String[] args) {
        long p,q,r;
        long l,k;
        long l1,k1;
        long m;
        long h=0;
        long y=0;
        Scanner in=new Scanner(System.in);
        p=in.nextLong();
        q=in.nextLong();
        r=in.nextLong();
        l1=in.nextLong();
        k1=in.nextLong();
        
        l=Math.min(l1, k1);
        long n=l;
        m=n;
        k=Math.max(l1, k1);
       
        for(long i;l<=k;l++){
            n=0;
            if(m%p==0){
               h=m/p; 
            }
            else{
                h=m/p+1;
            }
            n=n+h;
            
            if(m%q==0){
               h=m/q; 
            }
            else{
                h=m/q+1;
            }
            n=n+h;
            
            if(m%r==0){
               h=m/r; 
            }
            else{
                h=m/r+1;
            }
            
            n=n+h;
           
            if(n<=m){
                y=y+1;
            } 
            m=m+1;
        }
        System.out.println(y);
        
        
    }
}