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 main():
    N, A, B = raw_input().split(" ")
    N = int(N)
    A = int(A)
    B = int(B)
    ans = 0
    if(N % A == 0):
        n = N / A - 1
    else:
        n = N / A
    if(N % B == 0):
        m = N / B - 1
    else:
        m = N / B
    if(N % (A * B) == 0):
        o = N / (A * B) - 1
    else:
        o = N / (A * B)
    ans = (A * (n * (n + 1) / 2)) + (B * (m * (m + 1) / 2)) - ((A * B) * (o * (o + 1) / 2))
    print ans
main()