// AOJ 1105
#include<iostream>
#include<vector>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

typedef vector<int> Seq;

const int NMAX = 2000100;

int solve(int a, int b, int n) {
  bool countable[NMAX];
  REP(i, n + 1) {
    countable[i] = false;
  }
  countable[0] = true;
  
  int unables = 0;
  REP(i, n + 1) {
    if (countable[i]) {
      countable[i + a] = true;
      countable[i + b] = true;
    } else {
      unables++;
    }
  }
  return unables;
}

int main() {
  int a, b, n;
  while (cin >> n >> a >> b and n + a + b) {
    cout << solve(a, b, n) << endl;
  }
}