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;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll n,l,r;

bool check(ll y,const vector<ll> &v){
    bool res;
    rep(i,v.size()){    
        if(y % v[i] == 0)return i%2 == 0;
    }
    return v.size()%2 == 0;
}

int main(){
    while(cin >> n >> l >> r && n){
        vector<ll> v(n);
        rep(i,n)cin >> v[i];
        ll ans = 0;
        for(ll i = l;i <= r;i++){
            if(check(i,v))ans++;
        }
        cout << ans << endl;
    }
}

C++: #include <bits/stdc++.h> 
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)
typedef long long ll;ll MM = 1000000000;ll mod = MM + 7;

int main(){
  while(1){
  int n,l,r,cnt=0; cin>>n>>l>>r;
  if(n==0&&l==0&&r==0) break;
    vector<int>a(n);
  rep(i,n) cin>>a.at(i);
  
    for(int i=l;i<=r;i++){
 for(int k=0;k<n;k++){
   
   if(i%a.at(k)==0){
  if((k+1)%2==1) cnt++;
  break;
  }
 
   else if(k==n-1) {
 if(n%2==0) cnt++;
   break;
 }
   
 }
  }
    
   cout<<cnt<<endl; 
  }
}

C++: #include <iostream>

using namespace std;

int main(){
  
  int a[50];
  int n, l, r, j;
  int cnt_in;
  int ans[10000] = {0};

  for(;;){
    cin >> n >> l >> r;
    if(n == 0 && l == 0 && r == 0){
      break;
    }
    for(int i = 0; i < n; i++){
      cin >> a[i];
    }
    
    for(int i = l; i <= r; i++){
      for(j = 0; j < n; j++){
	if(i % a[j] == 0){
	  if((j+1) % 2 == 1){
	    ans[cnt_in]++;
	  }
	  break;
	}
      }
      if(j == n){
	if(n % 2 == 0){
	  ans[cnt_in]++;
	}
      }
    }

    cnt_in++;

  }

  for(int i = 0; i < cnt_in; i++){
    cout << ans[i] << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <tuple>
#include <queue>
#include <set>
#include <cstdio>
#include <climits>
#include <cmath>
#include <array>
#include <functional>
#include <list>
#include <iomanip>
#include <set>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const double eps=1e-9;
const int inf=1e9;
typedef pair<int,int> P;
int n,l,r;
int main(void)
{
  while(cin >> n >> l >> r && n)
    {
      vi A;
      for(int i=0;i<n;i++)
	{
	  int a;
	  cin >> a;
	  A.push_back(a);
	}
      int ans=0;
      for(int j=l;j<=r;j++)
	{
	  bool ca=false;
	  for(int i=0;i<n;i++)
	    {
	      if(j%A[i]==0)
		{
		  ca=true;
		  if((i+1)%2!=0) 
		    {
		      ans++;
		    }
		  break;
		}
	    }
	  if(ca) continue;
	  else
	    {
	      if(n%2==0) ans++;
	    }	    
	}
      cout << ans << endl;
    }
  return 0;
}

C++: #include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>
#define FOR(i,a,b) for (int i=(a),for_##i##_max=(b);i<=(for_##i##_max);++i)
#define RFOR(i,a,b) for (int i=(a),rfor_##i##_min=(b);i>=(rfor_##i##_min);--i)
#define REP(i,n) for (int i=0,rep_##i##_len=(n);i<(rep_##i##_len);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

namespace { // Basics

template<typename T>
void chmin(T &x, T y) {
  x = std::min(x, y);
}

template<typename T>
void chmax(T &x, T y) {
  x = std::max(x, y);
}

template<typename T>
__attribute__((unused))
const auto minimum = static_cast<T const &(*)(T const &, T const &)>(std::min);

template<typename T>
__attribute__((unused))
const auto maximum = static_cast<T const &(*)(T const &, T const &)>(std::max);

template<typename T>
__attribute__((unused))
T constexpr infty = std::numeric_limits<T>::max / 3;
template<>
__attribute__((unused))
auto constexpr infty<int> = 1'100'100'100;
template<>
__attribute__((unused))
auto constexpr infty<long long int> = 100'500'400'300'200'100LL;

using lli = long long int;
using ld = long double;

} // namespace

using namespace std;

void solve(int N, int L, int R, vector<int> const &seq) {
  int cnt = 0;
  FOR(x, L, R) {
    int i = 0;
    while (i < N && x % seq[i] != 0) { ++i; }
    if ((i < N && i % 2 == 0) || (i == N && N % 2 == 0)) { ++cnt; }
  }
  cout << cnt << endl;
}

int main() {
  // cout << fixed << setprecision(10);
  int N, L, R;
  while (cin >> N >> L >> R && N) {
    vector<int> seq;
    REP(i, N) {
      int A; cin >> A;
      seq.push_back(A);
    }
    solve(N, L, R, seq);
  }
  return 0;
}

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

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

int main() {
    int 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];

        int ans = 0;
        for (; l <= r; l++) ans += is_uruu(l, A);
        cout << ans << endl;
    }
}