#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 31) - 1;
int gcd(int a, int b) {
  if (a < b) a ^= b ^= a ^= b;
  return (b) ? gcd(b, a % b) : a;
}
int main() {
  int n, m;
  cin >> n >> m;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  int d = a[0];
  for (int i = 1; i < n; ++i) d = gcd(d, (a[i]));
  while (d % 2 == 0) d /= 2;
  long long ans = 0;
  int u = sqrt(d);
  for (int i = 1; i <= u; ++i)
    if (d % i == 0) {
      int j = i;
      while (j <= m) {
        ans += m - j;
        j *= 2;
      }
      j = d / i;
      if (j == i) break;
      while (j <= m) {
        ans += m - j;
        j *= 2;
      }
    }
  cout << ans << '\n';
}
