loop {
	n, a, b = gets.split.map &:to_i
	break if n == 0
	table = [true]
	count = 0
	(1..n).each{|i|
		table[i] |= table[i-a] if i >= a
		table[i] |= table[i-b] if i >= b
		count += 1 if !table[i]
	}
	p count
}