#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
#define RSort(a) sort(a.rbegin(), a.rend())
#define Output(a) printf("%d %s", a, "\n")

typedef long long int ll;
typedef vector<int> vi;
typedef vector<long long> vll;

const ll INF = 0x1fffffffffffffff;
const ll MOD = 1000000007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve(){
    ll n; cin >> n;
    vll a(n);
    rep(i, n) cin >> a[i];
    vll b(200);
    rep(i, n) b[a[i] % 200]++;
    ll ans = 0;
    rep(i, 200){
        if(b[i] >= 2){
            ans += (b[i] * (b[i] - 1)) / 2;
        }
    } 
    cout << ans << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    solve();
}

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

ll gcd(ll a,ll b){
    return b==0?a:gcd(b,a%b);
}

const int L=72;

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

  ll A,B;
  cin>>A>>B;

  vector<ll> v;
  for(ll i=A;i<=B;i++) v.push_back(i);
  int V=v.size();

  vector<int> is_prime(L+1,1);
  is_prime[0]=0;
  is_prime[1]=0;
  for(int i=2;i<=L;i++){
      if(is_prime[i]==0) continue;
      for(int j=2;i*j<=L;j++) is_prime[i*j]=0;
  }
  vector<int> primes;
  for(int i=2;i<=L;i++) if(is_prime[i]) primes.push_back(i);
  int P=primes.size();

  vector<vector<ll>> dp(V+1,vector<ll> (1<<P,0));
  dp[0][0]=1;
  for(int i=0;i<V;i++){
      for(int j=0;j<(1<<P);j++){
          ll value=dp[i][j];
          if(value==0) continue;
          dp[i+1][j]+=value;
          {
              int state=0;
              rep(k,P) if(v[i]%primes[k]==0) state+=(1<<k);
              if((j&state)==0) dp[i+1][j^state]+=value;
          }
      }
  }

  ll ans=0;
  rep(j,(1<<P)) ans+=dp[V][j];
  cout<<ans<<endl;

  return 0;
}
