#include <bits/stdc++.h>
using namespace std;
long long int a[1000005];
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<long long int> nums;
int main() {
  long long int n, m;
  scanf("%lld %lld", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long int g = 0;
  for (int i = 1; i <= n; i++) g = gcd(g, a[i] - 1);
  while (g % 2 == 0) g /= 2;
  for (long long int i = 1; i * i <= g; i++) {
    if (g % i == 0) {
      nums.push_back(i);
      if (g / i != i) nums.push_back(g / i);
    }
  }
  long long int ans = 0;
  for (int i = 0; i < nums.size(); i++) {
    long long int v = nums[i];
    while (v <= m) {
      ans += (m - v);
      v = v * 2LL;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
