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>
#include<algorithm>
#include<list>

using namespace std;
using vec = vector<int>;
using lst = list<int>;

bool solve()
{
    int n,l,r;
    cin >> n >> l >> r;

    if(n==0)return 0;

    vec ar(r-l+1);
    lst A;

    for(int i=0;i<n;++i)
    {
        int a;cin >> a;
        A.push_back(a);
    }
    A.push_back(1);

    while(!A.empty())
    {
        for(int i=l;i<=r;++i)
        {
            if(i%A.back()==0)
            {
                ar[i-l] = A.size() % 2;
            }
        }
        A.pop_back();
    }

    int ans = 0;
    for(int i=l;i<=r;++i)
    {
        ans += ar[i-l];
    }

    cout << ans << endl;

    return true;
}

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

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <numeric>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
#define fcout cout<<fixed<<setprecision(10)
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
//template<typename T>void pp(T x){cout<<x<<endl;}

using namespace std;
template<typename T> void test(vector<T> v){for(int i=0;i<v.size();i++){if(i)cout<<" ";cout<<v[i];}cout<<endl;}

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

C++: 
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>
#include <sstream>

#define all_range(C) std::begin(C), std::end(C)

int n;
int A[55];
bool is_uruu(int x) {
	for (int i = 0; i < n; i++)
	{
		if (x % A[i] == 0) {
			return i % 2 == 0;
		}
	}
	return n%2 == 0;
}

int main()
{
	using std::endl;
	using std::cout;
	using std::cin;

	while (true)
	{
		int l, r;
		cin >> n>>l>>r;
		if (n==0 && l==0 && r == 0) { break; }

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

		int count = 0;
		for (int i = l; i <= r; i++)
		{
			if (is_uruu(i)) {
				++count;
			}
		}
		//cout << "OUT!!!";
		cout << count << endl;
	}

	return 0;
}
#endif

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

bool uruu(int n, vector<int> &a, int x){
    rep(i,n){
        if(x % a[i] == 0) return (i%2 == 0);
    }
    return (n%2 == 0);
}

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

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

int main() { 
  for(;;) { 
    int n, l, r; 
    std::cin >> n >> l >> r; 
    if (n == 0 && l == 0 && r == 0) { break; } 
    std::vector<int> xs(n); 
    for(int i = 0; i < n; ++i) std::cin >> xs[i]; 
    int res = 0; 
    for(int y = l; y <= r; ++y) {
      bool flag = false;
      for(int i = 0; i < n; ++i) { 
        if (y % xs[i] == 0) { 
          if (i % 2 == 0) { 
            res += 1; 
          }
          flag = true;
          break;
        }
      }
      if (!flag) {
        if (n % 2 == 0) {
          res += 1;
        }
      }
    }    
    printf("%d\n", res); 
  } 
}

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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)

using namespace std;

int main() {
  int n,l,r;
  while( cin >> n >> l >> r , n | l | r) {
    vector<int> A(n);
    rep(i,n) cin >> A[i];
    int cnt = 0;
    REP(x,l,r+1) {
      rep(i,n) {
	if( x % A[i] == 0 ) {
	  if( ( i + 1 ) & 1 ) {
	    ++cnt;
	  }
	  goto Skip;
	}
      }
      if( !( n & 1 ) ) ++cnt;
    Skip:;
    }
    cout << cnt << endl;
  }
  return 0;
}

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

using namespace std;

#define FOR(i,a,b) for(int i=a;i<b;++i)
#define REP(i,n) FOR(i,0,n)
#define PB push_back

int main() {
    while (true) {
        int n, l, r;
        cin >> n >> l >> r;
        if (n == 0 && l == 0 && r == 0)
            break;
        vector<int> v[2];
        FOR(i,l,r+1)
            v[0].PB(i);

        int res = 0;
        REP(i, n) {
            int a;
            cin >> a;
            v[1-i%2].erase(v[1-i%2].begin(), v[1-i%2].end());
            int count = 0;
            for (const auto & e : v[i%2]) {
                if (e % a == 0)  {
                    ++count;
                }
                else
                    v[1-i%2].PB(e);
            }
            if (i % 2 == 0)
                res += count;
        }
        if (n % 2 == 0)
            res += v[0].size();
        cout << res << endl;
    }
}