#!/usr/bin/env python3 #coding:utf-8 import math import string import random import heapq from sys import stdin # import numpy as np # from matplotlib import pyplot as plt def gcd(a,b): while b>0: t=a a=b b=t%b return a def lcm(a,b): return a/gcd(a,b)*b def main(): read=stdin.readline #edit here! t,a,b=map(int,read().split()) ans=(t-1)//a+(t-1)//b+1-(t-1)//lcm(a,b) print(int(ans)) if __name__ == '__main__': main()