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:
def gcd(a,b):
        min = b
        max = a
        g = 0
        if (a < b):
                min = a
                max = b
        while ((max % min) > 0):
                t = max % min
                max = min
                min = t
        return min

s = raw_input()
lst = s.split(' ')
n = int(lst[0])
a = int(lst[1])
b = int(lst[2])

sum = 0
for x in xrange(a,n,a):
        sum = sum + x
for x in xrange(b,n,b):
        sum = sum + x

g = gcd(a,b)
lcm = (a*b)/g
for x in xrange(lcm,n,lcm):
        sum = sum - x

print sum