#include using namespace std; typedef long long ll; ll n,a,b,c,ans; ll gcd(ll x,ll y){ if(y==0)return x; return gcd(y,x%y); } int main(void){ cin>>n>>a>>b; c=a/gcd(a,b)*b; ans+=(n+a-1)/a; ans+=(n+b-1)/b; ans-=(n+c-1)/c; cout<