#include <stdio.h>

int main(){
	int n,a,b;
	while(~scanf("%d %d %d",&n,&a,&b)){
		if(n==0 && a==0 && b==0) break;

		int count = 0;
		int k,i,j;
		for(k=0;k<=n;k++){
			int found = 0;
			for(i=0;i<=n;i++){
				for(j=0;j<=n;j++){
					if(k == a*i+b*j) found = 1;
				}
			}

			if(!found) count++;
		}

		printf("%d\n",count);
	}
}