import java.util.Scanner;

public class Lubenice {

    public static void main(String[] args) {
      
        int p,q,r;
        int l,k;
        int l1,k1;
        int m;
        int h=0;
        int y=0;
        Scanner in=new Scanner(System.in);
        p=in.nextInt();
        q=in.nextInt();
        r=in.nextInt();
        l1=in.nextInt();
        k1=in.nextInt();
        
        l=Math.min(l1, k1);
        int n=l;
        m=n;
        k=Math.max(l1, k1);
       
        for(int 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);
    }
}