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>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,l,r;
  while(cin>>n>>l>>r,n+l+r){
    vi A(n);
    for(auto &a:A)cin>>a;
    ll ans=0;
    for(int i=l;i<=r;i++){
      bool fl=true;
      for(int j=0;j<n;j++){
	if(i%A[j] == 0){
	  fl = false;
	  if(j%2==0)ans++;
	  break;
	}
      }
      if(fl){
	if(n%2==0)
	  ans++;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#define LL long long
#define REP(i, n) for(int i=0;i<(n);++i)
#define REPA(i, n) for(int i=1;i<(n);++i)
#define lp(i, n) for(int i=-;i<(n);++i)
#define PII pair<int, int>
#define PLL pair<long long, long long>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define DEKAI ((int)1e9+7)
#define ALL(x) (x).begin(), (x).end()
#define BIT(x) (1<<(x))
#define foreach(i, n) for(auto &i:(n))
using namespace std;

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

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

        int ans=0;
        for(int x=l;x<=r;x++){
            bool flag=false;
            for(int i=0;i<n;i++){
                if(x%a[i]==0){
                    flag=true;    
                    if(i%2==0){
                        ans++;
                    }
                    break;
                }
            }
            if(!flag and n%2==0){
                ans++;
            }
        }
        cout<<ans<<endl;
    }
}

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

int A[51];

int main(){
    int n,l,r;
    
    while(true){
        cin >> n >> l >> r;
        if(n == 0){
            break;
        }
        for(int i=1; i<=n; i++){
            cin >> A[i];
        }

        int counter = 0;

        for(int num=l; num<=r; num++){
            bool flag = false;
            for(int i=1; i<=n; i++){
                if(num%A[i] == 0){
                    if(i%2==1){
                        counter++;
                    }
                    flag = true;
                    break;
                }
            }
            if(flag){
                continue;
            }

            if(n%2==0){
                counter++;
            }
        }

        cout << counter << endl;
    }

    return 0;
}

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

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) RFOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1 << 30;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, SZ(s)) {
    cout << s[i] << " ";
  }
  cout << endl;
}

int main () {
  cin.tie(0);
  cout << setprecision(10);

  while(1) {
    int n, l, r; cin >> n >> l >> r;
    if(n == 0) break;
    vi a(n);
    REP(i, n) cin >> a[i];
    int ans = 0;
    FOR(i, l, r+1) {
      REP(j, n) {
        if(i%a[j] == 0) {
          ans += (j % 2 == 0) ? 1 : 0;
          break;
        }
        if(j == n-1) {
          ans += (n % 2 == 0) ? 1 : 0;
        }
      }
    }
    cout << ans << endl;
  }
}

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

using namespace std;


int main(){
    
    int n,l,r;
    while(cin >> n >> l >> r){
        if(n == 0 && l == 0 && r == 0)
            return 0;
        vector<int> vec;
        for(int i = 0;i < n;i++){
            int b;cin >> b;
            vec.push_back(b);
        }
        int ans = 0;
        for(int i = l;i <= r;i++){
            bool f = true;
            bool e = false;
            for(int j = 0;j < n;j++){
                if(i % vec.at(j) == 0){
                    f = false;
                    if((j + 1) % 2){
                        e = true;
                    }
                    break;
                }
            }
            
            if(f && n%2 == 0){
                e = true;
            }
            
            if(e){
                ans++;
               // cout << i << endl;
            }
        }
       
        //cout<<endl;
        cout<<ans<<endl;
    }
    
    return 0;
}