#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b) return gcd(b, a % b);
  return a;
}
const long long MAXN = 100005;
long long n, m;
long long a[MAXN];
void load() {
  scanf("%I64d%I64d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%I64d", a + i);
    --a[i];
  }
}
long long ans;
void get(long long t) {
  while (t <= m) {
    ans += m - t;
    t <<= 1;
  }
}
void work() {
  long long commonD = a[1];
  for (int i = 2; i <= n; ++i) commonD = gcd(commonD, a[i]);
  while (0 == commonD % 2) commonD >>= 1;
  for (int i = 1; i * i <= commonD; i += 2)
    if (0 == commonD % i) {
      get(i);
      if (i * i != commonD) get(commonD / i);
    }
  printf("%I64d\n", ans);
}
int main() {
  load();
  work();
  return 0;
}
