t,a,b=gets.split(" ").map{|e| e.to_i} t-=1 c=a.lcm(b) puts t/a+t/b-t/c+1