D. Two Arithmetic Progressionstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two arithmetic progressions: a1k + b1 and a2l + b2. Find the number of integers x such that L ≤ x ≤ R and x = a1k' + b1 = a2l' + b2, for some integers k', l' ≥ 0.InputThe only line contains six integers a1, b1, a2, b2, L, R (0 < a1, a2 ≤ 2·109,  - 2·109 ≤ b1, b2, L, R ≤ 2·109, L ≤ R).OutputPrint the desired number of integers x.ExamplesInput2 0 3 3 5 21Output3Input2 4 3 0 6 17Output2
Input2 0 3 3 5 21
Output3
['math', 'number theory', '*2500']