#include using namespace std; typedef long long int64; int N, L, H, C[10]; int64 lcm(int64 a, int64 b) { return (a / __gcd(a, b) * b); } int beet(int x) { int64 ret = 0; for(int i = 0; i < (1 << N); i++) { int64 latte = 1; for(int j = 0; j < N; j++) { if((i >> j) & 1) latte = lcm(latte, C[j]); if(latte > x) break; } int64 st = __builtin_popcount(i); if(st & 1) ret += (x / latte) * st; else ret -= (x / latte) * st; } return (ret); } int main() { cin >> N >> L >> H; for(int i = 0; i < N; i++) cin >> C[i]; cout << beet(H) - beet(L - 1) << endl; }