#include using namespace std; #define REP(i, n) for(ll (i) = 0; (i) < (n); (i)++) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) typedef long long ll; ll gcm(ll a, ll b){ ll c; if(a < b){ c = a; a = b; b = c; } while(b){ c = a%b; a = b; b = c; } return a; } int main(void){ ll t, a, b; cin >> t >> a >> b; ll lcm = a*b/gcm(a, b); ll ans = t/a+t/b-t/lcm+1; if(t%a == 0) ans--; if(t%b == 0) ans--; if(t%lcm == 0) ans++; cout << ans << endl; return 0; }