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() {
    int n, l, r, result;

    vector<int> A;
    bool f;
    while (cin >> n >> l >> r, n) {
        A.resize(n);

        result = 0;

        for (int i = 0; i < n; i++) {
            cin >> A[i];
        }
        for (int i = l; i <= r; i++) {
            f = false;
            for (int j = 0; j < n; j++) {
                if (i % A[j] == 0) {
                    if ((j + 1) % 2 == 1) {
                        result++;
                    }
                    f = true;
                    break;
                }
            }
            if (f == false) {
                if (n % 2 == 0) {
                    result++;
                }
            }
        }
        cout << result << endl;
    }
}

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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    int n, l, r;
    while (cin >> n >> l >> r and n and l and r) {
        vector<int> a(n);
        rep(i, n) cin >> a[i];
        int ans = 0;
        for (int x=l; x<=r; ++x) {
            bool ok = false;
            rep(i, n) {
                if (x%a[i] == 0) {
                    if (i%2 == 0) ans++;
                    ok = true;
                    break;
                }
            }
            if (!ok) {
                if (n%2 == 0) ans++;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

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

int main() {
    int n, l, r;
    while(cin >> n >> l >> r, n){
        int a[55];
        for(int i=0;i<n;i++){
            cin >> a[i];
        }
        a[n] = 1;
        int cnt = 0;
        for(int y=l; y<=r; y++){
            for(int i=0;i<=n;i++){
                if(y%a[i]==0){
                    if(i%2==0)cnt++;
                    break;
                }
            }
        }
        cout << cnt << endl;
    }
    return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())




int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);


	int a[50];
	int n, l, r;
	
	while (cin >> n >> l >> r, n) {
		rep(i, n)cin >> a[i];

		int ans = 0;
		for (int x = l; x <= r;x++) {
			int idx = -1;
			rep(i, n) {
				if (x%a[i]==0) {
					idx = i;
					break;
				}
			}

			if (idx!=-1) {
				if (idx % 2 == 0)ans++;
			}
			else if (n%2==0) {
				ans++;
			}

		}
		cout << ans << endl;

	}



	return 0;
}

C++: #include "iostream"
#include "random"
#include "string"
#include "bitset"
#include "algorithm"
#include "map"
#include "queue"
#include "list"
#include "set"
#include "climits"
#include "iomanip"
#include "stack"
#include "functional"

using namespace std;

int N, M, K, L, R, H, W;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> N >> M >> K;
	while (N) {
		vector<int>v(N);
		for (auto &i : v)cin >> i;
		int ans = 0;
		for (int i = M; i <= K; i++) {
			int st = 10000;
			for (int j = 0; j < N;j++) {
				if (i%v[j] == 0) {
					st = min(st, j);
				}
			}
			if (st == 10000) {
				if (N % 2 == 0)ans++;
			}
			else if (st % 2==0) {
				ans++;
			}
		}
		cout << ans << endl;
		cin >> N >> M >> K;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n,l,r,a[50],j;
  while(cin>>n>>l>>r&&n&&l&&r){
    int cnt=0;
    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) break;
      }
      if(j<n){
	if((j+1)%2) ++cnt;
      }else{
	if(!n) ++cnt;
      }
    }
    cout<<cnt<<endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep3(i, l, n) for (int i = l; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define out(a) cout << a << endl
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)


int main() {
    int n;
    while (cin >> n && n) {
        int l, r; cin >> l >> r;
        int a[n]; rep(i, n) cin >> a[i];
        int cnt = 0;
        rep3(x, l, r + 1) {
            int tmp = inf; int key = -1;
            rep(i, n) {
                if (x % a[i] == 0) {
                    if (tmp > a[i]) {
                        tmp = a[i];
                        key = i + 1;
                        break;
                    }
                }
            }
            if (tmp == inf) {
                if (n % 2 == 0) {
                    cnt++;
                    //out(x);
                }
            } else {
                if (key % 2 == 1) {
                    cnt++;
                    //out(x << " " << key);
                }
            }
        }
        out(cnt);
    }
}