#include<bits/stdc++.h>
using namespace std;
int main()
{
cin.tie(0)->sync_with_stdio(0);
	freopen("CHIAHET.INP","r",stdin);
    freopen("CHIAHET.OUT","w",stdout);
    long long a,b,n;
    cin>>n>>a>>b;
    long long t = a * b;
    cout<<((n / a + n / b) - 2*(n/t)); 
    
}