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;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) FOR(i,0,b)
#define INF mugen
#define dump(x) cerr<<#x<<"="<<x<<endl
#define ALL(a) (a).begin(),(a).end()
#define EACH(e,v) for(auto& e:v)
#define SORT(v) sort(ALL(v))
#define PERM(v) SORT(v);for(bool c##p=1;c##p;c##p=next_permutation(ALL(v)))
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef pair<int,int> P;
template <class T> void chmin(T & a, T const & b) { if (b < a) a = b; }
template <class T> void chmax(T & a, T const & b) { if (b > a) a = b; }
template <typename T>
string to_string(const T &n){ostringstream stm;stm << n;return stm.str();}
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
using ll = long long;
const ll mod = 1000'000'007;
 
vector<int> vec;
signed main(){
    int n,l,r;
    while(cin>>n>>l>>r,n){
        vec.clear();
        rep(i,n){
            int a;cin>>a;
            vec.push_back(a);
        }

        int ans=0;


        int daiji=-1;
        for(int num=l;num<=r;num++){
            daiji=-1;
            for(int i=0;i<vec.size();i++){
                if(num%vec[i]==0){
                    daiji=i+1;
                    break;
                }
            }
            //dump(daiji);


            if(daiji==-1){
                if(vec.size()%2==0){
                    ans++;
                }
            }else if((daiji)%2==1){
                ans++;
            }
        }
        cout<<ans<<endl;

        

    }
 
}

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>



using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)












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

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

int main(){

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

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
const ll MOD = 1e9+7;

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

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

using namespace std;
using ll = long long;

int main(){
    ll n,l,r;
    while(cin>>n>>l>>r and n>0 and l>0 and r>0){
        ll ans=0;
        vector<ll> A(n);
        for(auto &&e:A)
            cin>>e;
        for(ll x=l; x<=r; ++x){
            ll i;
            for(i=0; i<n; ++i){
                if(x%A[i]==0){
                    if((i+1)%2==1){
                        ++ans;
                    }
                    break;
                }
            }
            if(i==n){
                if(n%2==0){
                    ++ans;
                }
            }
        }
        cout<<ans<<endl;
    }
}

C++: #include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, lint> pll;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T> bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}
template<class T> T div_floor(const T a, const T b){return a>=0 ? a/b : (a+1)/b-1;}
template<class T> T div_ceil(const T a, const T b){return a>=0 ? (a-1)/b+1 : a/b;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

int main(){
    int n, l, r;
    while(scanf("%d%d%d", &n, &l, &r) && n){
        int a[n];
        rep(i, n) scanf("%d", &a[i]);
        int ans = 0;
        auto check = [&](int x){
            rep(i, n)if(x%a[i] == 0) return (i+1)%2;
            return 1-n%2;
        };
        For(x, l, r+1) ans += check(x);
        printf("%d\n", ans);
    }
}