#include <bits/stdc++.h>
using namespace std;
const double eps = 1.0e-11;
const double pi = acos(-1.0);
int gcd(int x, int y) {
  while (x && y) {
    if (x > y)
      x %= y;
    else
      y %= x;
  }
  return x + y;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> d(n);
  int gg;
  for (long long i = 0; i < n; i++) {
    cin >> d[i];
    if (!i)
      gg = d[i] - 1;
    else
      gg = gcd(gg, d[i] - 1);
  }
  long long res = 0;
  set<int> diff;
  for (int i = 1; i * i <= gg; ++i) {
    if (gg % i == 0) {
      for (int tt = i; tt <= m; tt *= 2) diff.insert(tt);
      for (int tt = gg / i; tt <= m; tt *= 2) diff.insert(tt);
    }
  }
  for (int tt = gg; tt <= m; tt *= 2) diff.insert(tt);
  for (set<int>::iterator it = diff.begin(); it != diff.end(); ++it) {
    res += m - *it;
  }
  cout << res << endl;
  return 0;
}
