#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) using ll = long long; const int inf=1e9+7; const ll longinf=1LL<<60 ; const ll mod=1e9+7 ; ll gcd(ll x,ll y){ return y?gcd(y,x%y):x; } ll lcm(ll x,ll y){ return x/gcd(x,y)*y; } int main(){ ll a,b,t; cin>>t>>a>>b; ll l = lcm(a,b); cout<<(t+a-1)/a+(t+b-1)/b-(t+l-1)/l<