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;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

int main(){
	
	int n,l,r;
	while(cin >> n >> l >> r,n+l+r){
		
		vector<pair<ll,ll>> v;
		REP(i,n){
			int tmp;cin >> tmp;
			v.PB(MP(tmp,i+1));
		}
		
		
		ll ans = 0;
		
		for(int i = l;i <= r;i++){
			bool flag = false;
			
			for(int j = 0;j < n;j++){
				if(i % v[j].FI == 0){
					flag = true;
					if(v[j].SE % 2 != 0)ans++;
					break;
				}
			}
			
			if(!flag && n % 2 == 0)ans++;
		}
		
		cout << ans << endl;
		
	}
	
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

using lint = long long;
using ldouble = long double;

bool solve() {
    int N, L, R;
    cin >> N >> L >> R;
    if (N == 0) return false;

    vector<int> A(N);
    for (auto& a : A) cin >> a;

    int ans = 0;
    for (int x = L; x <= R; ++x) {
        int i;
        for (i = 0; i < N; ++i) {
            if (x % A[i] == 0) break;
        }

        ans += (i % 2 == 0);
    }

    cout << ans << endl;
    return true;
}

int main() {
    while (solve()) {}
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n,l,r,cnt=0,ind;
  cin >> n>>l>>r;
  while(n!=0){
    int a[n];
    cnt=0;
    for(int i=0;i<n;i++){
      cin >> a[i];
    }
    for(int i=l;i<=r;i++){
      ind=-1;
      for(int j=0;j<n;j++){
        if(i%a[j]==0){
          ind=j+1;
          break;
        }
      }
      if(ind==-1){
        if(n%2==0)cnt++;
      }else{
        if(ind%2!=0)cnt++;
      }
    }
    cout << cnt << endl;
    cin >> n >> l >> r;
  }
}

C++: #include <bits/stdc++.h>

int main(){
    while(true){
        int n,l,r;
        int ans=0;
        std::cin>>n>>l>>r;
        if(n==0)break;
        std::vector<int> a;
        for (int i = 0; i < n; ++i) {
            int t;
            std::cin>>t;
            a.emplace_back(t);
        }
        for (int i = l; i <= r; ++i) {
            bool f=false;
            for (int j = 1; j <= n; ++j) {
                if(j%2==1){
                    if(i%a[j-1]==0){++ans;f= true;break;}
                }
                else {
                    if(i%a[j-1]==0){f= true;break;}
                }
            }
            if(!f&&n%2==0)++ans;
        }
        std::cout<<ans<<std::endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <fstream>
#include <string>
#include <sstream>


using namespace std;

struct data {
	int x, y;
};

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

	}
	/*
	while (true) {
		int n;
		int a[405][405];
		int l = 200;
		int r = 200;
		int u = 200;
		int d = 200;
		cin >> n;
		struct data data[201];
		data[0] = 
		for (int i = 1; i < n; i++) {
		
		}
	}*/
}

C++: #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
void solve(int N,int L,int R){
    vector<int> V(N);
    rep(i,0,N)cin >> V[i];
    auto judge = [&](int x) -> bool{
        rep(i,0,N){
            if(x % V[i] == 0)return i%2 == 0;
        }
        return N % 2 == 0;
    };
    int cnt = 0;
    rep(i,L,R+1)cnt += judge(i);
    cout << cnt << endl;
}
main(){
    int N,L,R;
    cin >> N >> L >> R;
    while(N){
        solve(N,L,R);
        cin >> N >> L >> R;
    }
}

C++: #include <iostream>
#include <vector>

using namespace std;

int main(void) {
	bool find;
	int res,n,l,r;
	while (cin >> n >> l >> r||n,l,r) {
		vector<int> A(n);
		for (int i = 0; i < n; ++i) {
			cin >> A[i];
		}
		res = 0;
		for (int num = l; num < r+1; ++num) {
			find = false;
			for (int i = 0; !find && i < n; ++i) {
				if (num%A[i] == 0) {
					find = true;
					if (i%2 == 0) {
						++res;
					}
				}
			}
			if (!find && n%2 == 0) {
				++res;
			}
		}
		cout << res << endl;
	}
	return 0;
}