#include<stdio.h>
#include<string.h>
#define MAX 1000000
int can[MAX+1];

int main(){
	int n,a,b,ans,i;
	while(scanf("%d %d %d",&n,&a,&b),n||a||b){
		memset(can,0,sizeof(can));
		can[0]=1;
		ans=0;
		for(i=0;i<=n;i++){
			if(can[i]){
				if(i+a<=n)can[i+a]=1;
				if(i+b<=n)can[i+b]=1;
			}
			else ans++;
		}
		printf("%d\n",ans);
	}
}