#include <bits/stdc++.h>
using namespace std;
long long Get(int i, int m) {
  long long res = 0;
  for (int j = i; j < m; j *= 2) res += (long long)(m - j);
  return res;
}
int GCD(int a, int b) {
  int t;
  while (b) {
    t = a % b;
    a = b;
    b = t;
  }
  return a;
}
void Solve() {
  int a, t, i, k = 0, n, m;
  long long Ans = 0;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a);
    a--;
    while (!(a & 1)) a /= 2;
    if (!k)
      k = a;
    else
      k = GCD(k, a);
  }
  for (i = 1; t = k / i, i * i <= k; i++)
    if (k % i == 0) {
      Ans += Get(i, m);
      if (t != i) Ans += Get(t, m);
    }
  printf("%I64d\n", Ans);
}
int main() {
  Solve();
  return 0;
}
