#include<stdio.h>
int main(void){
	int f[1000001],n,a,b,i,j,t,ans;
	while(1){
		scanf("%d %d %d",&n,&a,&b);
		if(n==0&&a==0&&b==0){
			break;
		}
		for(i=1;i<=n;i++){
			f[i]=0;
		}
		f[0]=1;
		ans=0;
		for(i=1;i<=n;i++){
			if(i-a>=0&&f[i-a]==1){
				f[i]=1;
			}
			if(i-b>=0&&f[i-b]==1){
				f[i]=1;
			}
			if(f[i]!=1){
				ans++;
			}
		}
		printf("%d\n",ans);
	}
}