import java.util.*;
import java.math.BigInteger;

public class Zadatak1 {

    public static void main(String[] args) {

        Scanner a = new Scanner(System.in);
       int x;
       BigInteger p=new BigInteger(a.nextInt());
       BigInteger q=new BigInteger(a.nextInt());
       BigInteger r=new BigInteger(a.nextInt());
       BigInteger L=new BigInteger(a.nextInt());
       BigInteger R=new BigInteger(a.nextInt());
       BigInteger x=new BigInteger(a.nextInt());
       BigInteger N=new BigInteger(0); 
       BigInteger i=new BigInteger(); 
       
       for(i=L;i<=R;i++){
           x=(int)i/p+(int)i/q+(int)i/r;
           if(x<=N)
           N++;
       }
       System.out.println(N);


    }
}