#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
const long long INF = 1LL << 60;
const long long MINF = -1LL << 60;
vector<string> parse(string s, string c) {
  int len = c.length(), p = -len, np;
  vector<string> ans;
  do {
    np = s.find(c, p + len);
    ans.push_back(s.substr(p + len, np - p - len));
    p = np;
  } while (p != string::npos);
  return ans;
}
int n, m, g, a[100005];
long long ans;
set<int> S;
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
void dfs(int x) {
  while (x <= m) {
    if (S.find(x) != S.end()) return;
    S.insert(x);
    ans += m - x;
    x <<= 1;
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]--;
  }
  g = a[0];
  for (int i = 0; i < n; i++) g = gcd(g, a[i]);
  for (int i = 1; i * i <= g; i++)
    if (g % i == 0) {
      dfs(i);
      dfs(g / i);
    }
  cout << ans << endl;
  return 0;
}
