import scala.annotation.tailrec

object Main extends App {
  import scala.io.StdIn._
  solve
  @tailrec def solve: Unit = {
    val Array(n, l, r) = readLine.trim.split(' ').map(_.toInt)
    if (n == 0) return
    val t = Array.tabulate(n){_ ⇒ readLine.trim.toInt}
    val default = if (n % 2 == 0) true else false
    val memo = Array.tabulate(r - l + 1){_ ⇒ Int.MaxValue}
    for ((a, i) ← t.zipWithIndex) {
      for (year ← memo.indices){
        if ((year + l) % a == 0 && memo(year) > i) memo(year) = i
      }
    }
    println(
      memo.count{ minI ⇒ if (minI == Int.MaxValue) default else minI % 2 == 0}
    )
    solve
  }
}

