#include <iostream>
#include <vector>
using namespace std;
int main() {
  int n, a, b;
  while (cin >> n >> a >> b, n+a+b) {
    vector<int> table(n+1);
    table[a] = 1;
    table[b] = 1;
    for (int i=1; i<=n; i++)
      if ((i>a&&table[i-a]) || (i>b && table[i-b]))
        table[i] = 1;
    int ans = 0;
    for(int i=1; i<=n; i++)
      if(table[i] == 0)
        ans++;
    cout << ans << endl;
  }
}