Define an infinite sequence as follows:
A_i = 1 if i \le 0,
A_i = A_{\lfloor i / p \rfloor - x} + A_{\lfloor i / q \rfloor - y} if i \ge 1
Given , , , , and , find the -th element of the sequence (indices start from ).
Five integers , , , , (0 \le n \le 10^{13}, 2 \le p, q \le 10^9, 0 \le x, y \le 10^9).
Print the value of A_n.
Example 1
Example 2