#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; t--; ll c=a/gcd(a,b)*b; if(c>0){ cout << t/a+t/b-t/c+1 << endl; } else{ cout << t/a+t/b+1 << endl; } }