Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo()
	defer io.Flush()
	for {
		n, l, r := io.NextInt(), io.NextInt(), io.NextInt()
		if n == 0 {
			break;
		}
		A := make([]int, n)
		for i := 0; i < n; i++ {
			A[i] = io.NextInt()
		}
		cnt := 0
		for x := l; x <= r; x++ {
			for i := 0; i < n; i++ {
				if x%A[i] == 0 {
					if i%2 == 0 {
						cnt++
					}
					goto SKIP
				}
			}
			if n%2 == 0 {
				cnt++
			}
		SKIP:
		}
		io.Println(cnt)
	}
}

// I/O template
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buff []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buff = append(buff, line...)
		if !isPrefix {
			break
		}
	}
	return string(buff)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	s := io.tokens[io.nextToken]
	io.nextToken++
	return s
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntSlice(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *Io) PrintStringSlice(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func ExampleIo() {
	io := NewIo()
	defer io.Flush()
	a := make([]int, 0, 3)
	a[0], a[1], a[2] = io.NextInt(), io.NextInt(), io.NextInt()
	io.Println(a)
	io.PrintIntSlice(a)
	Log("io", a)
}

Python: def solve(n ,l, r, A):
    res = 0
    for x in range(l, r+1):
        for i in range(n):
            if (not x%A[i]) :
                res += 0 if (i&1) else 1
                break
        else:
            res += 0 if (n&1) else 1
    return res



def main():
    ans = []
    while True:
        n, l, r = map(int, input().split())
        if (not n) and (not l) and (not r):
            break
        A = [int(input()) for i in range(n)]
        ans.append(solve(n,l,r,A))
    for i in ans:
        print(i)


main()

Python: while 1:
    n, l, r = map(int, input().split())
    if n == 0: break

    a = []
    for i in range(n):
        a.append(int(input()))

    gusu = False
    if len(a) % 2 == 0: gusu = True

    count = 0
    for x in range(l, r + 1):
        for i in range(len(a)):
            comp = a[i]
            if x % comp == 0:
                if i % 2 == 0:
                    count += 1
                    break
                else: break
        else:
            if gusu: count += 1
    print(count)

Python: import math
for i in range(50):
	n,l,r=map(int,input().split())
	if n==0 and l==0 and r==0:
		break
	else:
		a=[]
		for ii in range(n):
			a.append(int(input()))
		ans=0
		

		for k in range(l,r+1):

			for s in range(math.ceil(n/2)):
				if k%a[2*s]==0:
					ans+=1
					break
				elif 2*s+1==n :
					break
				elif k%a[2*s+1]==0:
					break
				elif s==math.ceil(n/2)-1 and n%2==0:
					ans+=1
					break
				else:
					continue

					


		print(ans)

Python: while 1:
    n,l,r=map(int, input().split())
    if n==0:
        break
    a = []
    for i in range(n):
        a.append(int(input()))
    c = 0
    for j in range(l, r+1):
        for i in range(n):
            if j%a[i]==0:
                if i%2==1:
                    break
                else:
                    c += 1
                    break
            if i==n-1 and n%2==0:
                c += 1
    print(c)

Python: # AOJ 2882: Generalized Leap Years
# Python3 2018.7.10 bal4u

while True:
	n, l, r = map(int, input().split())
	if n == 0: break
	A = [int(input()) for i in range(n)][::-1]
	y = [0]*(r+1)
	v = 2 - (n&1)	# v = 1 if n is odd
	for a in A:
		for i in range(a, r+1, a): y[i] = v
		v = 3-v
	ans = k = 0
	for i in range(l, r+1):
		if y[i] == 0: k += 1
		elif y[i] == 1: ans += 1
	if n & 1 == 0: ans += k
	print(ans)

Python: while True:
    n, l, r = map(int, input().split())
    if n == 0:
        break
    A = [int(input()) for _ in range(n)]

    ans = 0
    for x in range(l, r + 1):
        checked = False
        for i, a in enumerate(A):
            if x % a == 0:
                ans += (i % 2 == 0)
                checked = True
                break
        if not checked and n % 2 == 0:
            ans += 1
    print(ans)

Python: while True:
    n, l, r = map(int, input().split())
    if n+l+r == 0:
        break
    As = [int(input()) for _ in range(n)]
    ans = 0
    for jj in range(l, r+1):
        flag = False
        for i, a in enumerate(As):
            if flag:
                break
            if jj % a == 0:
                if (i+1) % 2 == 1:
                    flag = True
                    ans += 1
                    break
                else:
                    flag = True
        if flag:
            continue
        else:
            if n % 2 == 0:
                ans += 1

    print(ans)

Python: ans = []

while True:
    n, l, r = map(int, input().split())
    if n + l + r == 0:
        break

    a = []
    for i in range(n):
        a.append(int(input()))
   
    cnt = 0
    for x in range(l, r + 1):
        
        for j in range(n):
            if x % a[j] == 0:
                if (j + 1) % 2 == 1:
                    cnt += 1
                break
            elif j == (n - 1):
                if n % 2 == 0:
                    cnt += 1
                 
    ans.append(cnt)

for i in ans:
    print(i)

Python: a = list(map(int,input().split()))
b = [0]*a[0]
su = 0
s = 0
while sum(a) != 0:
	b = [0] * a[0]
	for i in range(a[0]):
		b[i] = int(input())

	for i in range(a[1],a[2]+1):
		for j in range(a[0]):
			if i % b[j] == 0:
				if j % 2 == 0:
					s += 1
					su += 1
					break
		if s == 0:
			if a[0] % 2 == 0:
				su += 1

		s = 0

	print(su)
	su = 0

	a = list(map(int,input().split()))

Python: ans_list = []

while True:
    n,l,r = map(int,input().split())
    if (n,l,r) == (0,0,0):
        break
    A = [int(input()) for _ in range(n)]
    cnt = 0
    for x in range(l,r+1):
        for i,a in enumerate(A,1):
            if x % a == 0:
                if i % 2 == 1:
                    cnt += 1
                break
            if i == n:
                if n % 2 == 0:
                    cnt += 1
    ans_list.append(cnt)

for ans in ans_list:
    print(ans)

Python: a = list(map(int,input().split()))
b = []
su = 0
s = 0
for i in range(a[0]):
	b.append(int(input()))

for i in range(a[1],a[2]+1):
	for j in range(a[0]):
		if a % b[j] == 0:
			su += 1
			if(j % 2 == 0):
				s += 1
				break
	if su == 0:
		if a[0] % 2 == 0:
			s += 1
	su = 0

print(s)

Python: while(True):
	n,l,r = map(int, input().split())
	if (n+l+r)==0:break
	a = list(int(input()) for i in range(n))
	count = 0
	for year in range(l,r+1):
		var = n
		for i in range(n):
			if year%a[i]==0:
				var = i
				break
		if var%2==0:
			count += 1
	print(count)