#include #include #include #include #include #include #include #include using namespace std; #define INF 1000000007 #define LINF (1LL << 62) typedef long long i64; typedef pair P; i64 gcd(i64 x, i64 y){ if(y == 0) return x; return gcd(y, x%y); } i64 lcm(i64 x, i64 y){ return x*y / gcd(x,y); } i64 n,a,b; int main(){ cin >> n >> a >> b; n--; cout << n/a + n/b - n/lcm(a,b) + 1 << endl; return 0; }