#include using namespace std; using ll = long long; inline ll gcd(ll a, ll b) { if (b==0) return a; return gcd(b, a%b); } int main() { ll t,a,b; cin >> t >> a >> b; ll ans = t/a + t/b; ans -= (t/a)/(b/gcd(a,b)); cout << ans << endl; }