#include using namespace std; #define REP(i,a) for(int i = 0; i < (a); i++) #define ALL(a) (a).begin(),(a).end() typedef long long ll; typedef pair P; const int INF = 1e9; const int MOD = 1e9 + 7; long long GCD(long long m,long long n){ if(n == 0) return m; else return GCD(n,m % n); } long long LCM(long long m,long long n){ long long g = GCD(m,n); return m / g * n; } signed main(){ ll t,a,b; cin >> t >> a >> b; ll c = LCM(a, b); cout << (t + a - 1) / a + (t + b - 1) / b - (t + c - 1) / c << endl; }