Problem: Given three positive integers N, A and B (A < B < N), find the sum of all positive integers less than N, which are divisible by either A or B.

For example, when N = 20, A = 4 and B = 7, the possible values are 4, 7, 8, 12, 14, and 16. Their sum is 61.
Input Format
The only line of the input file contains three space separated integers N, A and B.

Output Format
Output the required sum.

Constraints
10 ≤ N ≤ 50000
2 ≤ A < B < N

SAMPLE INPUT
20 4 7

SAMPLE OUTPUT
61

Solution (in PYTHON):

Solution:
n,a,b=map(int,raw_input().split())
neww=n-1
termsa=neww/a
termsb=neww/b

suma=((termsa)*((2*a)+(termsa-1)*a))
x=a
a=b
termsa=termsb

#print termsa
#print a
sumb=((termsa)*((2*a)+(termsa-1)*a))
#print suma
#print sumb
a=x*b
termsa=neww/a

sumc=((termsa)*((2*a)+(termsa-1)*a))

print (suma+sumb-sumc)/2