#include <iostream>
#include <vector>
#include <algorithm>
#define llint long long

using namespace std;

llint t, a, b;

llint gcd(llint a, llint b)
{
	if(b == 0) return a;
	return gcd(b, a%b);
}

llint lcm(llint a, llint b)
{
	llint x = a / gcd(a, b);
	if(b >= t/x+1) return (llint)2e18;
	else return x*b;
}

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> t >> a >> b;
	cout << (t+a-1)/a+(t+b-1)/b-(t+lcm(a,b)-1)/lcm(a,b) << endl;
	
	return 0;
}