Who doesn't knows Tony Stark aka our beloved savior , Iron man. Well this time looks like he is in trouble . While fighting with Ultron he suffered a huge loss in his vitals . Ultron is also injured and escaped but he has caused serious damage to the location satelite of Stark enterprise and Jarvis is unable to tell his location surely .Jarvis has a hunch that Ultron is hiding on x axis between two co-ordinates (X1,X2) which belong to set S={ A, 2A, 3A, 4A .......,(N-1)A,N*A} and their summation (i.e. X1+X2 ) is divisble by K told by Jarvis
Find number of pairs of (X1,X2) to help Iron Man to get to Ulton and avenge what he has done to earth .....
Input Format:
The input contains 3 positive integers A, N and K.
Constraints:
1 <= A, N <= 10^9
1 <= K <= 10^6.
Output Format:
Print a single integer denoting the answer.
Sample Input :
1 3 3
Sample Output :
1
The set S is {1, 2, 3}. Possible pairs are (1,2), (2,3) and (1,3) out of which only (1,2) is the pair whose sum is divisible by 3. Hence answer is 1