/*
	
*/

#include<stdio.h>

int Main();
int GCM(int m, int n);
int LCM(int m, int n);

int main(int argc, char *argv[]){
	while( Main() == 0 );
	return 0;
}

int Main(){
	int n = 0, a = 0, b = 0, gcm = 0, cm = 0, count = 0, i = 0, j = 0;	//?????????????????\????????????a??¨b???a??¨b????????§??¬?´???°???a??¨b???????°???¬?????°??¨n????°???????????????????????????§?????????????????°???
	if( scanf("%d %d %d", &n, &a, &b) != 3 ){ return -1; }
	if( n == 0 || a == 0 || b == 0 ){ return 1; }
	char list[n+1];	//????????§????????????????????????????????????0????????????????????????1???
	for( i = 0; i < n+1; i++ ){ list[i] = 1; }
	gcm = GCM(a, b);
	cm = LCM(a, b);
	cm = (cm <= n ? cm : n);
	for( i = 0; a * i <= cm; i++ ){
		for( j = 0; a * i + b * j <= cm; j++ ){
			list[a*i+b*j] = 0;
		}
	}
	for( i = 1; i <= cm; i++ ){ count += (int)list[i]; }
	count += (n - cm) / gcm * (gcm - 1);
	count += (n - cm) % gcm;
	printf("%d\n", count);
	return 0;
}

int GCM(int m, int n){
	int r = 0;
	//m>=n??¨?????????
	if( m < n ){
		r = m;
		m = n;
		n = r;
	}
	r = m % n;
	while( r > 0 ){
		m = n;
		n = r;
		r = m % n;
	}
	return n;
}

int LCM(int m, int n){
	return (int)((long)m * n / GCM(m,n));	//??????????????????????????¢????????????long??§?¨????????????????int????????£???????????????
}