#include using namespace std; typedef long long ll; 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 c=a/gcd(a,b)*b; cout << (t+a-1)/a+(t+b-1)/b-(t+c-1)/c << endl; }