#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
int n, m;
vector<pair<long long, int> > dv;
set<int> st;
void calc(int idx, long long num) {
  if (idx == dv.size()) {
    while (num < n) {
      st.insert(num);
      num *= 2;
    }
    return;
  }
  for (int i = 0; i <= dv[idx].second; i++) {
    calc(idx + 1, num);
    num *= dv[idx].first;
  }
  return;
}
int main() {
  cin >> m >> n;
  int x = 0, t;
  for (int i = 0; i < m; i++) {
    cin >> t;
    t--;
    x = gcd(x, t);
  }
  for (int i = 2; i * i <= x; i++) {
    int cnt = 0;
    while (x % i == 0) {
      cnt++;
      x /= i;
    }
    if (cnt > 0) dv.push_back(pair<long long, int>(i, cnt));
  }
  if (x > 1) dv.push_back(pair<long long, int>(x, 1));
  calc(0, 1);
  long long res = 0;
  for (set<int>::iterator it = st.begin(); it != st.end(); it++) {
    int t = *it;
    res += n - t;
  }
  cout << res << endl;
  return 0;
}
