divide

Time limit: 2.9s Memory limit: 256MB Input: Output:

Who doesn’t love math 🙂
Let p, q and n be natural numbers. We will say that a pair of natural numbers (a, b) is interesting when:

  1. 1 ≤ a ≤ p
  2. 1 ≤ b ≤ q
  3. c=aba+b \displaystyle c=\frac{a \cdot b}{a + b} is a natural number, and 1 ≤ c ≤ n, that is the product aba \cdot b is divisible without remainder by the sum a + b, and their quotient is less than or equal to n.

The goal of this task is simple - find the number of interesting pairs!

Task

Write a program that given the three numbers p, q and n, computes the number of interesting pairs.

Input

The only line of the standard input contains the numbers p, q and n.

Output

On the single line of the standard output, print the number of interesting pairs. It is guaranteed that the answer less than 101810^{18}.

Constraints

  • 1p,q,n10101 ≤ p, q, n ≤ 10^{10}

Subtask 1 (5 points)

  • 1p,q,n21041 ≤ p, q, n ≤ 2 \cdot 10^4

Subtask 2 (10 points)

  • 1p,q,n2.51071 ≤ p, q, n ≤ 2.5 \cdot 10^7

Subtask 3 (10 points)

  • 1p,q,n2.51081 ≤ p, q, n ≤ 2.5 \cdot 10^8

Subtask 4 (10 points)

  • 1p,q,n21091 ≤ p, q, n ≤ 2 \cdot 10^9

Subtask 5 (10 points)

  • n=1010n = 10^{10}
  • p = q

Subtask 6 (10 points)

  • n=1010n = 10^{10}

Subtask 7 (45 points)

  • No other constraints

Examples

stdin

13 17 5

stdout

11

Log in or sign up to be able to send submissions!