You are given two arithmetic progressions: a1k+b1 and a2l+b2. Find the number of integers x such that L \le x \le R and x=a1k'+b1=a2l'+b2, for some integers k',l' \ge 0.
The only line contains six integers a1,b1,a2,b2,L,R (0 \lt a1,a2 \le 2 \cdot 109,-2 \cdot 109 \le b1,b2,L,R \le 2 \cdot 109,L \le R).
Print the desired number of integers x.