#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N 1000000

static int h[N + 1];

int main(void) {
  int p;
  
  for (;;) {
    int n, a, b;
    int res;
    
    scanf("%d%d%d", &n, &a, &b);
    if (n == 0 && a == 0 && b == 0) break ;
    memset(h, 0, sizeof(h));

    res = 0;    
    h[0] = 1;
    for (p = 0; p <= n; ++p) {
      if (h[p] == 0) {
        ++res;
        continue ;
      }
      if (p + a <= n)
        h[p + a] = 1;
      if (p + b <= n)
        h[p + b] = 1;
    }
    
    printf("%d\n", res);
  }

  return EXIT_SUCCESS;
}