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)
}

C++: #include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(int i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int n,r,l;
int a[55];

int main(){
	while(1){
		cin>>n>>l>>r;
		if(n==0&&l==0&&r==0)break;
		REP(i,n)cin>>a[i];
		int ans=0;
		for(int i=l;i<r+1;i++){
			for(int j=0;j<n;j++){
				if(i%a[j]==0){
					if(j%2==0){
						ans++;
					}
					break;
				}
				if(j==n-1){
					if(n%2==0)ans++;
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vl vector<ll>
#define pl pair<ll,ll>
#define rep(i,b) for(ll i=0;i<b;i++)
#define all(v) (v).begin(),(v).end()

int main(){
    int n,l,r;
    while(cin>>n>>l>>r,n){
        int sum=0;
        int a[55];
        rep(i,n)cin>>a[i];
        for(int i=l;i<=r;i++){
            a[n]=i;
            for(int j=0;j<=n;j++){
                if(i%a[j]==0){
                    if(j%2==0)sum++;
                    break;
                }
            }
        }
        cout<<sum<<endl;
    }
}

C++: #include <iostream>
#include <vector>
using namespace std;

int main(void){
    int num, l, r, i, j, ans = 0;
    while(true){
        cin >> num >> l >> r;
        if(num == 0)
            break;
        vector<int> a(num);
        for(i = 0; i < num; i++){
            cin >> a[i];
        }
        for(ans = 0, i = l; i<= r; i++){
            for(j = 0; j < num; j++){
                if(i % a[j] == 0){
                    if(!(j & 1))
                        ans++;
                    break;
                }
            }
            if(j == num && num % 2 == 0)
                ans++;
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int n, l, r;
int a[55];

int main(void)
{
	while(1){
		cin >> n >> l >> r;
		if(n == 0 && l == 0 && r == 0) break;
		for(int i = 1; i <= n; i++) cin >> a[i];
		
		int ans = 0;
		for(int i = l; i <= r; i++){
			for(int j = 1; j <= n; j++){
				if(i % a[j] == 0){
					if(j % 2) ans++;
					goto end;
				}
			}
			if(n % 2 == 0) ans++;
			end:;
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include <stdio.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))

ll a[60];
int main(){
	ll n,l,r;
	while(scanf("%lld%lld%lld",&n,&l,&r),n){
		ll ans=0;
		rep(i,0,n)scanf("%lld",a+i);
		rep(x,l,r+1){
			int flag=-1;
			rep(i,0,n)if(x%a[i]==0){
				flag=(i+1)%2;
				break;
			}
			if(flag==-1)flag=(n+1)%2;
			ans+=flag;
		}
		printf("%lld\n",ans);
	}
}

C++: #include<bits/stdc++.h>
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr double INFD = 1e100;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
// ---------------------------------------------------------------------------

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N,l,r;
    cin >> N >> l >> r;
    while(N != 0){
        vector<int> A(N+1);
        for(int i=1; i<=N; i++){
            cin >> A[i];
        }
        int cnt = 0;
        for(int x=l; x<=r; x++){
            bool did = false;
            for(int i=1; i<=N; i++){
                if(x%A[i] == 0){
                    did = true;
                    if(i%2){
                        cnt++;
                    }
                    break;
                }
            }
            if(!did and N%2==0) cnt++;
        }
        cout << cnt << enld;
        cin >> N >> l >> r;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
    ll n,l,r;
    while(1){
        cin>>n>>l>>r;
        if(n==0&&r==0&&l==0)break;
        ll a[n];
        for(ll i=0;i<n;i++)cin>>a[i];
        ll res = 0;
        bool flag=false;
        for(ll i=l;i<=r;i++){
            flag=false;
            for(ll j=0;j<n;j++){
                if(i%a[j]==0){
                    if((j+1)%2==1){
                        res++;
                        //cout<<i<<endl;
                        flag=true;
                    }else{
                        flag=true;
                    }
                    break;
                }
            }
            if(!flag){
                if(n%2==0)res++;
            }
        }
        cout<<res<<endl;
    }
}