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