#include "bits/stdc++.h" using namespace std; void solve() { long t, a, b; cin >> t >> a >> b; long g = __gcd(a, b), c = a * b / g; cout << (t + a - 1) / a + (t + b - 1) / b - (t + c - 1) / c << endl; } int main() { solve(); return 0; }