#include <bits/stdc++.h>
using namespace std;
long long unsigned int gcd(long long unsigned int a, long long unsigned int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long unsigned int n, m;
  cin >> n >> m;
  long long unsigned int x;
  long long unsigned int g = -1;
  for (int i = 0; i < n; i++) {
    cin >> x;
    x--;
    if (g == -1)
      g = x;
    else {
      g = gcd(g, x);
    }
  }
  while (g % 2 == 0) g /= 2;
  long long unsigned int u = sqrt(g);
  vector<long long unsigned int> div;
  for (long long unsigned int i = 1; i <= u; i++) {
    if (g % i == 0) {
      div.push_back(i);
      if (i * i != g) {
        div.push_back(g / i);
      }
    }
  }
  long long unsigned int ans = 0;
  for (int i = 0; i < div.size(); i++) {
    long long unsigned int j = div[i];
    while (j < m) {
      ans = ans + m - j;
      j *= 2;
    }
  }
  cout << ans;
}
