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 <iostream>
#include <string>
#include <vector>
#include <algorithm>

#define REP(i, a, b) for (int i = (a); i < (b); i++)

using namespace std;

int main() {
  int n, l, r;
  while(cin >> n >> l >> r, n + l + r) {
    vector<int> A(n);
    REP (i, 0, n) {
      cin >> A[i];
    }
    int ans = 0;
    REP (i, l, r + 1) {
      bool ok = false;
      REP (j, 0, n) {
	if (i % A[j] == 0) {
	  ok = true;
	  if ((j + 1) % 2 == 1) {
	    ans++;
	    //cout << i << endl;
	  }
	  break;
	}
      }
      if ((!ok) && n % 2 == 0) {
	//cout << "!" << ok << " " << n % 2 << " " << i << endl;
	ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

bool is_uruu(int y, vector<int> &A){
  for(size_t i = 0; i < A.size(); ++i){
    if(y%A[i]) continue;
    return (i+1)%2;
  }
  return (A.size()%2 == 0);
}

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

C++: #include <bits/stdc++.h>
using namespace std;
#define REP(i, s, e) for(int i = (int)(s); i < (int)(e); ++i)
#define rep(i, n) REP(i, 0, n)

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

C++: //#include <bits/stdc++.h>
//#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>
 
 
#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979
#define MAXI 7500000
 
using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;
 
int dy[5] = { 0,0,1,-1,0 };
int dx[5] = { 1,-1,0,0,0 };
 
int main(void){

	while(1){
		int n,l,r;
		int count=0;
		int a[4001];
		bool flag=false;

		cin>>n>>l>>r;
		if(n==0){
			break;
		}
		FOR(i,1,n){
			cin>>a[i];
		}

		FOR(i,l,r){
			flag=false;

			FOR(j,1,n){
				if(i%a[j]==0){
					if(j%2==1){
						flag=true;
						count++;
					}else{
						flag=true;
					}
					break;
				}
			}
			if(flag==false){
				if(n%2==0){
					count++;
				}
			}
		}

		cout<<count<<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 = 0;
			REP(j, n) {
				if (i % A[j] == 0) {
					if (j%2 == 0) res++;
					ok = 1;
					break;
				}
			}
			if (!ok && n % 2==0) res++;
		}
		cout << res << endl;
	}
}

C++: #define  _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#pragma comment (linker, "/STACK:526000000")

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144*2LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

unsigned long xor128() {
	static unsigned long x = 123456789, y = 362436069, z = 521288629, w = time(NULL);
	unsigned long t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

void init() {
	iostream::sync_with_stdio(false);
	cout << fixed << setprecision(20);
}

#define int ll
void solve() {
	while (true) {
		int n, l, r;
		cin >> n >> l >> r;
		if (n == 0) return;
		vector<int> inputs;
		REP(i, n) {
			int a;
			cin >> a;
			inputs.push_back(a);
		}
		inputs.push_back(1);
		int ans = 0;
		for (int i = l; i <= r; ++i) {
			for (int q = 0; q < inputs.size(); ++q) {
				if (i % inputs[q] == 0) {
					ans += (q + 1) % 2;
					break;
				}
			}
		}
		cout << ans << endl;
	}
}
#undef int
int main() {
	init();
	solve();
}