#include #include #include #include using namespace std; typedef long long int ll; long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; } int main(){ ll t,a,b; cin >> t >> a >> b; ll ans=0; ans+=(t+a-1)/a; ans+=(t+b-1)/b; if((double)a/GCD(a,b)>=(double)t/b){ ans--; cout << ans << endl; return 0; } else{ ll Lcm=a/GCD(a,b)*b; ans-=(t+a/GCD(a,b)*b-1)/(a/GCD(a,b)*b); } cout << ans << endl; }