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 getGcd(a,b):
    if(a%b==0):
        return b;
    return getGcd(b,a%b);
t=raw_input().split(' ');
a=long(t[1]);
b=long(t[2]);
n=long(t[0]);
gcd=1;
if(a>b):
	gcd=getGcd(a,b);
else:
	gcd=getGcd(b,a);
lcm=(a*b)/gcd;
a1=0;
b1=0;
c1=0;
if(long(n/a)*a==n):
    a1=long(n/a)-1;
else:
    a1=long(n/a);

if((n/b)*b==n):
    b1=long(n/b)-1;
else:
    b1=long(n/b);
if(long(n/lcm)*lcm==n):
    c1=long(n/lcm)-1;
else:
    c1=long(n/lcm);

sum1=a1*(a1+1);
sum1/=2;
sum2=b1*(b1+1);
sum2/=2;
sum3=c1*(c1+1);
sum3/=2;
print a*sum1+b*sum2-lcm*sum3;