// Aizu 1105: Unable Count
// 2017.9.12 bal4u@uu

#include <stdio.h>
#include <string.h>
#define min(a,b) ((a)<=(b)?(a):(b))

char f[2000003];

int main()
{
	int n, a, b, k, s;

	while (scanf("%d%d%d", &n, &a, &b) && n) {
		memset(f, 0, n+1); f[0] = f[a] = f[b] = 1, s = min(a, b);
		for (k = s; k <= n; k++) if (f[k]) f[a+k] = 1, f[b+k] = 1;
		for (k = s, s = 0; k <= n; k++) s += f[k];
		printf("%d\n", n-s);
	}
	return 0;
}