#include <stdio.h>
     
int main(void){
    int a, b, t, i, j, k, ans, flg;

	while( scanf( "%d %d %d", &t, &a, &b ) != EOF ) {
		ans = 0;
		if( !(t|a|b) ) break;
		for( k = 1; k <= t; k++ ) {
			flg = 0;
			for( i = 0; a*i <= k && flg == 0; i ++ )
				for( j = 0; a*i + b*j <= k && flg == 0; j++ ) {
					if( a*i + b*j == k ) {
						flg = 1;
						//printf("%d = %d * %d + %d * %d\n", k, a, i, b, j );
						ans ++;
					}
				}
		}
		printf("%d\n",t-ans);
	}

    return 0;
}