#include #include #include #include #include #include #include #include using namespace std; #define INF 11000000000 #define MOD 1000000007 typedef long long ll; typedef pair P; //計算量はO(log max(a,b)) ll lcm(ll x,ll y){ ll mindata,maxdata; mindata=min(x,y); maxdata=max(x,y); while(maxdata%mindata!=0){ ll temp; temp=maxdata%mindata; maxdata=mindata; mindata=temp; } return mindata; } int main(){ ll T,A,B,a,count=0; cin>>T>>A>>B; if(A>=100000000000 && B>=100000000000){ int i=1; while(A*i<=(T-1)){ if(A*i%B==0) count++; i++; } ll ans=(T-1)/A+(T-1)/B+1-count; cout<