#!/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 main(): read=stdin.readline #edit here! t,a,b=map(int,read().split()) ans=(t+a-2)//a+(t+b-2)//b+1-(t+math.lcm(a,b)-2)//math.lcm(a,b) print(ans) if __name__ == '__main__': main()