#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define boostIO                   \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)
#define rep(i, b) for (int i = 0; i < b; i++)
#define repn(i, n) for (int i = 1; i <= n; i++)
#define rrep(i, b, a) for (int i = b; i >= a; i--)
#define sz(v) (v.empty() ? 0 : v.size())
#define all(v) v.begin(), v.end()
#define mem(a, val) memset(a, val, sizeof(a))
#define trav(a, x) for (auto &a : x)
#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define int long long
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for (long blockTime = 0; (blockTime == 0 ? (blockTime = clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
#define maxn 100005
#define mod 998244353
const int INF = 1e10;
typedef pair<int, int> pii;

signed main() {
    boostIO;
    int n, k;
    cin >> n >> k;
    int ans = 0;
    for (int i = 2; i <= (2 * n); i++) {
        int K = k + i;
        if(K < 2 or K > 2 * n) continue;
        int ir = min(n, i - 1);
        int il = max(1LL, i - n);
        int kr = min(n, K - 1);
        int kl = max(1LL, K - n);
        int ni = (ir >= il ? ir - il + 1 : 0);
        int nk = (kr >= kl ? kr - kl + 1 : 0);
        ans += (ni * nk);
    }
    cout << ans << endl;
    return 0;
}
// XD
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define fi first
#define se second
#define pb push_back
//#define mp make_pair
#define foru(i, l, r) for(int i = l; i <= r; i++)
#define ford(i, r, l) for(int i = r; i >= l; i--)

typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;

const int N = 2005;

const int oo = 1e18 + 7, mod = 1e9 + 7;

int n, a[N];

set<int> numbers;
map<int, int> mp;

void process(){
	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> a[i];
		if(numbers.find(a[i]) != numbers.end()) continue;
		numbers.insert(a[i]);
		for(int j = 1; j <= sqrt(a[i]); j++){
			if(a[i] % j) continue;
			mp[a[i] / j] = __gcd(mp[a[i] / j], j);
			mp[j] = __gcd(mp[j], a[i] / j);
		}
	}
	int mini = (*numbers.begin());
	set<int> se;
	se.insert(mini);
	for(auto it : mp){
		if(it.fi > mini) break;
		if(it.se != 1) continue;
		se.insert(it.fi);
	}
	cout << se.size();
}

signed main(){
	ios_base::sync_with_stdio(0);
	process();
}