#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (b) {
    int c = a % b;
    a = b;
    b = c;
  }
  return a;
}
void div_rec(vector<int>& r, vector<pair<int, int> >& f, int k, int c) {
  if (k == f.size()) {
    r.push_back(c);
    return;
  }
  for (int i = 0, ThxDem = f[k].second + 1; i < ThxDem; ++i)
    div_rec(r, f, k + 1, c), c *= f[k].first;
}
vector<int> divisors(int n) {
  vector<pair<int, int> > f;
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      int k = 0;
      while (n % i == 0) {
        k++;
        n /= i;
      }
      f.push_back(make_pair(i, k));
    }
  }
  if (n > 1) f.push_back(make_pair(n, 1));
  vector<int> r;
  div_rec(r, f, 0, 1);
  sort(r.begin(), r.end());
  return r;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int g = 0;
  while (n--) {
    int k;
    scanf("%d", &k);
    k--;
    while (k % 2 == 0) k /= 2;
    g = gcd(g, k);
  }
  auto v = divisors(g);
  long long r = 0;
  for (int d : v) {
    while (d <= m - 1) {
      r += m - d;
      d *= 2;
    }
  }
  printf("%lld\n", r);
  return 0;
}
