#include using namespace std; #define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i) #define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define rreps(i, n) for (int i = ((int)(n)); i > 0; i--) #define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) #define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i) #define FOR(e, c) for (auto &e : c) #define SORT(v, n) sort(v, v + n); #define vsort(v) sort(v.begin(), v.end()); #define rvisort(v) sort(v.begin(), v.end(), greater()); #define all(v) v.begin(), v.end() #define mp(n, m) make_pair(n, m); #define coutd(d) cout<; using vvi = vector; using vll = vector; using vvll = vector; using pii = pair; using ul = unsigned long; const int INF = 1e9; const int MOD = 1e9+7; const ll LINF = 1e18; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; } ll LCM(ll a, ll b) { return a * b / GCD(a, b); } int main(){ ll t,a,b;cin>>t>>a>>b; ll sum = 0; sum+=(t-1)/a; sum+=(t-1)/b; sum-=(t-1)/LCM(a,b); sum++; cout<