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 <vector>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, l, r;
	while (cin >> n >> l >> r && n) {
		vector<int> a(n);
		for (auto&& i : a) {
			cin >> i;
		}
		int ans = 0;
		bool found;
		for (int i = l; i <= r; i++) {
			found = false;
			for (int j = 0; j < n; j++) {
				if (i % a[j]) continue;
				found = true;
				if (j % 2 == 0) {
					ans++;
				}
				break;
			}
			if (!found) {
				ans += !(n % 2);
			}
		}
		cout << ans << "\n";
	}
}

C++: /**
 *    author:  otera    
**/
#include<iostream>
#include<string> 
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }

void solve() {
	int n, l, r;
    while(cin >> n >> l >> r) {
        if(n == 0 && l == 0 && r == 0) break;
        vector<int> a(n + 1);
        rep(i, n) {
            cin >> a[i];
        }
        a[n] = 1;
        int ans = 0;
        for(int x = l; x <= r; ++ x) {
            rep(i, n + 1) {
                if(x % a[i] == 0) {
                    if(i % 2 == 0) {
                        ++ ans;
                    }
                    break;
                }
            }
        }
        cout << ans << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

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

void solve(int n, int l, int r){
        int a[n] = {};
        for(int i=0; i<n; ++i) cin >> a[i];
        int ans = 0;
        for(int i=l; i<=r; ++i){
                bool f = n % 2 == 0;
                for(int j=0; j<n; ++j){
                        if(i % a[j] == 0){
                            f = j % 2 == 0;
                            break;
                        }
                }
                if(f) ++ans;
        }
        cout << ans << "\n";
}

int main(){
//      cin.tie(0);
//      ios::sync_with_stdio(false);
        while(1){
                int n, l, r;
                cin >> n >> l >> r;
                if(n == 0) return 0;
                solve(n, l, r);
        }
}

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

using namespace std;
using ll = long long int;
using lc = complex<double>;

int main(void) {
    constexpr ll MOD = 1e9 + 7;
    constexpr double PI = acos(-1);
    cout << fixed << setprecision(32);
    cin.tie(0); ios::sync_with_stdio(false);

    while(1) {
        ll n, l, r;
        cin >> n >> l >> r;
        if(!n) break;
        vector<ll> a(n);
        for(auto &e: a) cin >> e;

        ll res = 0;
        for(ll k=l; k<=r; k++) {
            ll i;
            for(i=0; i<n; i++)
                if(k % a[i] == 0) break;
            res += ~i&1;
        }
        cout << res << endl;
    }
}

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

int n, l, r;

bool check(int x, int *a){
    int i;
    for(i = 0; i < n; i++)  if(x % a[i] == 0)  break;
    if(i != n){
        return i%2 == 0;
    }else{
        return n%2 == 0;
    }
}

int main(){
    while(cin >> n >> l >> r, n+l+r){
        int a[n];
        for(int i = 0; i < n; i++)  cin >> a[i];
        int cnt = 0;
        for(int x = l; x <= r; x++) if(check(x, a)) cnt++;
        cout << cnt << endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=1; i<=n; i++)
using namespace std;
int main(){
  int n,l,r;
  while(cin >> n >> l >> r,n){
    int count=0;
    int a[51];
    a[0] = 0;
    rep(i,n) cin >> a[i];
    for(int x=l; x<=r; x++){
      bool flag=false;
      rep(i,n){
        if(x%a[i] == 0){
          flag = true;
          if(i%2 != 0) {
            count++;
          }
          break;
        }
      }
      if(flag == false && n%2 == 0) count++;
    }
    cout << count << endl;
  }
  return 0;
}

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

int main(){
  int n, l, r, A[100], j;


  while(1){
    int count = 0;
    cin>>n>>l>>r;

    if(n == 0 && l == 0 && r ==0) break;

    for(int i = 1; i <= n; i++){
      cin>>A[i];
    }

    for(int i = l; i <= r; i++){//cout<<i<<endl;
      int f = 0;
      for(j = 1; j <= n; j++){
        if(i%A[j] == 0){
          if(j%2 == 1){
            f = 1;
          } else {
            f = 0;
          }
          break;
          }
      }
      if(j == n+1){
        if(n%2 == 0) f = 1;
        else  f = 0;
      }
      if(f == 1) count++;

    }

    cout<<count<<endl;
  }


  return 0;
}