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 REP(i, n ,N) for(ll i = (n); i < (N); i++)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
ll inf = 1e18;

ll n, l, r;
ll a[55];
int main() {
	while (cin >> n >> l >> r && n > 0) {
		REP(i, 0, n) {
			cin >> a[i];
		}
		ll ans = 0;
		REP(x, l, r + 1) {
			bool ok = false;
			REP(i,0,n) {
				if (x % a[i] == 0) {
					ok = true;
					if (i % 2 == 0) {
						ans++;
					}
					break;
				}
			}
			if (!ok && n % 2 == 0) {
				ans++;
			}
		}
		p(ans);
	}

	return 0;
}

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

int main(){
  while(1){
    int n,l,r;
    cin >> n >> l >> r;
    if(n==0) return 0;
    vector<int> d(n);
    for(int i=0;i<n;i++) cin >> d[i];
    int count = 0;
    for(int i=l;i<=r;i++){
      bool ok=false;
      for(int j=0;j<n;j++){
	if(i%d[j]==0){
	  if(j%2==0) count++;
	  ok=true;
	  break;
	}
      }
      if(!ok&&n%2==0) count++;
    }
    cout << count << endl;
  }
  return 0;
}

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

using namespace std;

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

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

using namespace std;

int solve(){
  int n, l, r;
  int a[100];
  
  scanf("%d%d%d", &n, &l, &r);
  if(!n) return 0;
  
  for(int i=0;i<n;i++){
    scanf("%d", a+i);
  }

  int ans = 0;
  
  for(int i=l;i<=r;i++){
    int t = n;
    for(int j=0;j<n;j++){
      if(i % a[j] == 0){
        t = j;
        break;
      }
    }

    ans += t%2 == 0;
  }

  printf("%d\n", ans);
  
  return 1;
}

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

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

using namespace std;

#define reps(i, n, m) for (int i = (int) (n); i < (int) (m); i++)
#define rep(i, n) reps(i, 0, n)

int n, l, r;
vector<int> a;

bool init() {
  a.clear();
  cin >> n >> l >> r;
  if (n == 0) return false;
  a.resize(n);
  rep(i, n) {
    cin >> a[i];
  }
  return true;
}

int check(int x) {
  rep(i, n) {
    if (x % a[i] == 0) {
      return 1 - i % 2;
    }
  }
  return 1 - n % 2;
}


void solve() {
  int res = 0;
  reps(i, l, r+1) {
    res += check(i);
  }
  cout << res << endl;
}

int main() {
    while (init()) {
        solve();
    }
}

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

main(int argc, char const *argv[])
{
	int n,l,r;
	while(cin>>n>>l>>r,n)
	{
		int a[n],ans=0;
		for (int i = 0; i < n; ++i)
		{
			cin>>a[i];
		}

		for (int i = l; i <= r; ++i)
		{
			int f=1;
			for (int j = 0; j < n; ++j)
			{
				if(i%a[j]==0)
				{
					if(f%2) ++ans;
					f=0;
					break;
				}
				++f;
			}
			if(f%2) ++ans;
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <bitset>
#include <cstring>
#include <queue>
#include <stack>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
typedef long long ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	while(1){
		int n,l,r; cin >> n >> l >> r;
		if(n==0&&l==0&&r==0)break;
		vector<int> a(n);
		for(int i=0;i<n;i++){
			cin >> a[i];
		}
		auto uruu=[&](int x){
			for(int i=0;i<n;i++){
				if(x%a[i]==0)return (i+1)%2;
			}
			return (n+1)%2;
		};
		int res=0;
		for(int i=l;i<=r;i++){
			res+=uruu(i);
		}
		cout << res << endl;
	}
}

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

int solve(int n, int l, int r) {
    vector<int> A(n);
    int ans = 0;
    for (int i = 0; i < n; i++) {
        cin >> A[i];
    }

    for (int year = l; year <= r; year++) {
        bool flag = false;
        for (int i = 0; i < n; i++) {
            if (year % A[i] == 0) {
                if (i % 2 == 0)
                    ans++;
                flag = true;
                break;
            }
        }
        if (!flag && n % 2 == 0) ans++;
    }
    return ans;
}

int main(void) {
    int n, l, r;
    vector<int> ans;
    while (1) {
        cin >> n >> l >> r;
        if (!n && !l && !r) break;
        ans.push_back(solve(n, l, r));
    }
    for (int i : ans) cout << i << endl;
}

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

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, l, r;
  while (cin >> n >> l >> r, n) {
    vector<int> a(n);
    for (auto&& e : a) {
      cin >> e;
    }
    int res = 0;
    for (int x = l; x <= r; ++x) {
      int mi = n;
      for (int i = 0; i < n; ++i) {
        if (x % a[i] == 0) {
          mi = i;
          break;
        }
      }
      if (mi == n) {
        res += n % 2 == 0;
      } else {
        res += mi % 2 == 0;
      }
    }
    cout << res << '\n';
  }
}

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

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