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 <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
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; }

constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int inf = 1 << 28;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;

using namespace std;
typedef unsigned long long ull;
typedef long long ll;


bool check(int x, vector<int>& a) {
	int n = a.size();
	int i = 0;
	for (; i < n; i++) {
		if (x % a[i] == 0) {
			return i % 2 == 0;
		}
	}
	return (n % 2 == 0);

}
void solve() {
	int n, l, r; scanf("%d %d %d", &n, &l, &r); if (n == 0 and l == 0 and r == 0) exit(0);
	vector<int> a(n); for (int i = 0; i < n; i++) scanf("%d", &a[i]);
	int res = 0;
	for (int i = l; i <= r; i++) res += check(i, a);
	printf("%d\n", res);
}

int main()
{
	/*
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	*/

	int kkt = 89;
	while (kkt) {
		solve();
	}
	return 0;
}

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

int A[100]={0};
int l,n,r;

int solve();

int main(){
  int i,j,k,ans=0;
  while(1){
    cin >> n >> l >> r;
    if(n+l+r==0)break;
    ans = 0;
    for(i=0;i<n;i++)cin >> A[i];
    ans = solve();
    cout << ans << endl;
  }
  return 0;
}

int solve(){
  int i,j,now,countn=0;
  for(i=l;i<=r;i++){
    now = i;
    for(j=0;j<n;j++){
      if(j%2==0&&now%A[j]==0){
	countn++;
	break;
      }
      else if(j%2==1&&now%A[j]==0)break;
      if(j==n-1){
	if(n%2==0)countn++;
      }
    }
  }
  return countn;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    vector<int> ans(0);
    for(;;){
        int n,l,r; cin >> n >> l >> r;
        if (n == 0 && l == 0 && r == 0) break;
        int a[n+1];
        fill(a,a+n+1,0);
        for(int i = 1; i < n+1; i++){
            cin >> a[i];
        }
        bool flg;
        int cnt = 0;
        for(int i = l; i <= r; i++){
            int x = i;
            flg = false;
            for(int num = 1; num < n+1; num++){
                if (x % a[num] == 0){
                    flg = true;
                    if (num % 2 == 1){
                        cnt++;
                        break;
                    }
                }
                if(flg) break;
            }
            if (!flg){
                if (n % 2 == 0) cnt++;
            }
        }
        ans.push_back(cnt);
    }
    for(int i = 0; i < ans.size(); i++){
        cout << ans[i] << endl;
    }
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
    return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
    for(auto &e:u) fill_v<T>(e,v...);
}

int main(void){
    int64 n, l, r;
    while (cin >> n >> l >> r && n+l+r) {
        vector<int64> A(n);
        REP(i, n) cin >> A[i];

        int64 res = 0;
        FOR(i, l, r+1) {
            bool ok = 1;
            REP(j, A.size()) {
                if (i % A[j] == 0) {
                    if (j % 2 == 0) {
                        res++;
                    }
                    ok = 0;
                    break;
                }
            }
            if (ok && n % 2 == 0) {
                res++;
            }
        }
        cout << res << endl;
    }
}

C++: #include "bits//stdc++.h"
using namespace std;
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

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