while true
    n, l, r = gets.chomp.split.map(&:to_i)
    break if [n, l, r] == [0, 0, 0]
    arr = []
    n.times{arr << gets.to_i}
    sum = 0
    l.upto(r){|x|
        found = false
        arr.each_with_index{|y, i|
            if x % y == 0
                sum += 1 if i.even?
                found = true
                break
            end
        }
        sum += 1 if n.even? if !found
    }
    puts sum
end
