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