while 1:

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

	if n == 0: break

	dp = [0]*(n+1)

	if a < n+1: dp[a] = 1

	if b < n+1: dp[b] = 1

	for i in range(n+1):

		if dp[i]:

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

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

	print(n - sum(dp))
while 1:

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

	if n == 0: break

	dp = [0]*(n+max(a,b)+1)

	dp[a] = dp[b] = 1

	for i in range(n+1):

		if dp[i]:

			dp[i+a] = dp[i+b] = 1

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

while 1:
    n, a, b = list(map(int, input().split()))
    if n == 0:
        break
    dp = [0] * (n + max(a, b) + 1)
    dp[a] = dp[b] = 1
    for i in range(n + 1):
        if dp[i]:
            dp[i + a] = dp[i + b] = 1
    print(n - sum(dp[: n + 1]))

-    dp = [0] * (n + 1) -    if a < n + 1: -        dp[a] = 1 -    if b < n + 1: -        dp[b] = 1 +    dp = [0] * (n + max(a, b) + 1) +    dp[a] = dp[b] = 1 -            if i + a < n + 1: -                dp[i + a] = 1 -            if i + b < n + 1: -                dp[i + b] = 1 -    print(n - sum(dp)) +            dp[i + a] = dp[i + b] = 1 +    print(n - sum(dp[: n + 1]))