////////////////////////////////////////
///  tu3 pro-con template            ///
////////////////////////////////////////
#include <cassert>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <queue>
#include <string>
#include <complex>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <regex>
using namespace std;

//// MACRO ////
#define countof(a) (sizeof(a)/sizeof(a[0]))

#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i,n) for (int i = (n)-1; i >= 0; i--)
#define FOR(i,s,n) for (int i = (s); i < (n); i++)
#define RFOR(i,s,n) for (int i = (n)-1; i >= (s); i--)
#define pos(c,i) c.being() + (i)
#define allof(c) c.begin(), c.end()
#define aallof(a) a, countof(a)
#define partof(c,i,n) c.begin() + (i), c.begin() + (i) + (n)
#define apartof(a,i,n) a + (i), a + (i) + (n)

#define EPS 1e-9
#define INF (1L << 30)
#define LINF (1LL << 60)

inline int sign(double x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); }

//// i/o helper ////

struct _Reader { template <class T> _Reader operator ,(T &rhs) { cin >> rhs; return *this; } };
struct _Writer { bool f; _Writer() : f(false) { } template <class T> _Writer operator ,(const T &rhs) { cout << (f ? " " : "") << rhs; f = true; return *this; } };
#define READ(t,...) t __VA_ARGS__; _Reader(), __VA_ARGS__
#define WRITE(...) _Writer(), __VA_ARGS__; cout << endl

//// start up ////
void solve();
int main()
{
	solve();
	return 0;
}

////////////////////
/// template end ///
////////////////////
#define long long long

// 最大公約数
long gcd(long a, long b) { return b ? gcd(b, a%b) : a; }

// 最小公倍数
long lcm(long a, long b) { return a / gcd(a, b) * b; }

void solve()
{
	int cases = INF;
	REP(_, cases)
	{
		READ(int, n, a, b);
		if (!(n | a | b)) { break; }
		if (a > b) swap(a, b);
		vector<char> m(n + 1);
		
		int maxJ = lcm(a, b) / b;

		for (int i = 0; a * i <= n; i++)
		{
			for (int j = 0; a * i + b * j <= n && j < maxJ; j++)
			{
				m[a * i + b * j] = 1;
			}
		}
		WRITE(n + 1 - count(allof(m), 1));
	}
}