#include <stdio.h>

int main(void){
    int n, a, b;
    while(scanf("%d%d%d", &n, &a, &b) && n+a+b){
        int dp[1000001], ans = 0;
        for(int x = 0; x <= n; x++){
            dp[x] = 0;
        }
        dp[0] = 1;
        for(int x = 0; x <= n; x++){
            if(!dp[x]) ++ans;
            else{
                if(x+a <= n) dp[x+a] = 1;
                if(x+b <= n) dp[x+b] = 1;
            }
        }
        printf("%d\n", ans);
    }
}