while 1:

    n,a,b=list(map(int,input().split()))

    if n==a==b==0:break

    c=0;d=[1]+[0]*1000000

    for i in range(0,n+1):

        if d[i]:

            if i+a<=n:d[i+a]=1

            if i+b<=n:d[i+b]=1

        else:c+=1

    print(c)
while 1:

    n,a,b=list(map(int,input().split()))

    if n==a==b==0:break

    c=0;d=[1]+[0]*2000000

    for i in range(0,n+1):

        if d[i]:d[i+a]=d[i+b]=1

        else:c+=1

    print(c)
while 1:
    n, a, b = list(map(int, input().split()))
    if n == a == b == 0:
        break
    c = 0
    d = [1] + [0] * 1000000
    for i in range(0, n + 1):
        if d[i]:
            if i + a <= n:
                d[i + a] = 1
            if i + b <= n:
                d[i + b] = 1
        else:
            c += 1
    print(c)

while 1:
    n, a, b = list(map(int, input().split()))
    if n == a == b == 0:
        break
    c = 0
    d = [1] + [0] * 2000000
    for i in range(0, n + 1):
        if d[i]:
            d[i + a] = d[i + b] = 1
        else:
            c += 1
    print(c)

-    d = [1] + [0] * 1000000 +    d = [1] + [0] * 2000000 -            if i + a <= n: -                d[i + a] = 1 -            if i + b <= n: -                d[i + b] = 1 +            d[i + a] = d[i + b] = 1