#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; ll gcd(ll a, ll b){ if(b == 0) return a; return gcd(b, a % b); } ll lcm(ll a, ll b){ return a / gcd(a, b) * b; } int main() { cin.tie(0); ios::sync_with_stdio(false); ll t, a, b; cin >> t >> a >> b; t--; cout << t / a + t / b - t / lcm(a, b) + 1 << endl; }