#include using namespace std; typedef long long ll; const ll mod = 1000000007; const ll INF = mod * mod; #define rep(i,n) for(int i=0;i=0;i--) #define Rep(i,sta,n) for(int i=sta;i=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) ll gcd(ll a, ll b) { if (a==0) return b; else if (b==0) return a; else if (a>b) return gcd(b, a%b); else return gcd(a, b%a); } int main() { ll T, A, B; cin >> T >> A >> B; ll C = A * B / __gcd(A, B); ll ans = (ll)(T-1)/A + (ll)(T-1)/B - (ll)(T-1)/C + 1; cout << ans << endl; }