#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 = T/A + T/B - T/C + 1; if (T % A == 0) ans--; if (T % B == 0) ans--; if (T % C == 0) ans++; cout << ans << endl; }