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: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    def f(n,l,r):
        a = [I() for _ in range(n)]
        c = 0
        for t in range(l,r+1):
            k = -1
            for i in range(n):
                if t % a[i] == 0:
                    k = i
                    break
            if k < 0:
                k = n
            if k % 2 == 0:
                c += 1

        return c

    while 1:
        n,m,l = LI()
        if n == 0:
            break
        rr.append(f(n,m,l))

    return '\n'.join(map(str, rr))


print(main())

Python: while True:
  n, l, r = map(int, input().split())
  if n == 0 and l == 0 and r == 0:
    break
  else:
    a = [0 for i in range(n)]
    for i in range(n):
      aa = int(input())
      a[i] = aa
    cnt = 0
    for x in range(l, r + 1):
      flag = False
      for i in range(n):
        if x % a[i] == 0:
          flag = True
          break
      if (i+1) % 2 == 1 and flag == True:
        cnt += 1
      elif flag == False:
        if n % 2 == 0:
          cnt += 1
  print(cnt)

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

Python: "一般化うるう年"
while True:
    n, l, r = map(int, input().split())  # 数列の要素の個数はn個, lからrまでのxを試す
    if n == 0:
        break
    A = [int(input()) for _ in range(n)]

    ans = 0
    for x in range(l, r+1):
        flag = True
        for i in range(n):
            if x%A[i] == 0 and (i+1)%2 == 1:
                ans += 1
                flag = False
                break
            elif x%A[i] == 0 and (i+1)%2 == 0:
                flag = False
                break

        if flag:
            if n%2 == 0:
                ans += 1

    print(ans)

Python: while True:
    n, l, r = map(int, input().split())
    if n == l == r == 0:
        break
    A = [int(input()) for i in range(n)]
    ans = 0
    for x in range(l, r+1):
        for i in range(n):
            if x % A[i] == 0:
                if i % 2 == 0:
                    ans += 1
                break
            elif i == (n-1):
                if n % 2 == 0:
                    ans += 1
    print(ans)

Python: while True:
    n,l,r = map(int, input().split())
    if n==0 and l==0 and r==0:
        break
    a = [0]*n
    cnt = 0
    for i in range(n):
        a[i]=int(input())
        # aのリスト完成
    for x in range(l,r+1):
        for i in range(1,n+1):
            if x%a[i-1]==0:
                if i%2==1:
                    cnt += 1
                break
            if i==n and n%2==0:
                cnt += 1
    print(cnt)

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

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

Python: 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()))

    ans = 0

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

        a = 0

        for i in range(n):
            if y % A[i] == 0:
                a = i + 1
                break

        if a != 0 and a % 2 == 1:
            ans += 1

        if a == 0 and n % 2 == 0:
            ans += 1

    print(ans)

Python: 
while True:
	n,l,r = map(int,input().split())
	if n == 0:
		break
	a = []
	for _ in range(n):
		a.append(int(input()))
	a.append(1)
	ans = 0
	for i in range(l,r+1):
		for j,aa in enumerate(a):
			if i % aa == 0:
				if j % 2 == 0:
					ans += 1
				break
	print(ans)

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

    data = []
    for _ in range(n):
        data.append(int(input()))

    cnt = 0
    for i in range(l, r+1):
        for j, d in enumerate(data):
            if i % d == 0:
                if j % 2 == 0:
                    cnt += 1
                break
        else:
            if n % 2 == 0:
                cnt += 1

    print(cnt)

Python: 
while True:
    

    n,l,r = map(int,input().split())

    ans = 0

    if n == 0 and l == 0 and r == 0:
        break

    A = []

    for i in range(n):

        a = int(input())

        A.append(a)


    for x in range(r-l+1):

        x += l

        #print (x)

        for i in range(len(A)):

            
            flag = True

            if x % A[i] == 0:

                if i % 2 == 0:
                    ans += 1
                   # print (x,"は",A[i],i)


                #print (x,"はだめ",A[i],i)
                flag = False
                break

        if flag and len(A) % 2 == 0:

            #print (x , "x")

            ans += 1


    print (ans)