#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110000;
long long n, m, Data[MAXN], w, Ans;
long long Gcd(long long a, long long b) {
  if (!b)
    return a;
  else
    return Gcd(b, a % b);
}
int main() {
  scanf("%I64d%I64d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%I64d", &Data[i]);
  long long d = Data[1] - 1;
  while (d % 2 == 0) d /= 2;
  w = d;
  for (int i = 2; i <= n; i++) {
    long long a = Data[i] - 1;
    while (a % 2 == 0) a /= 2;
    w = Gcd(a, w);
  }
  for (int i = 1; i * i <= w; i++) {
    if (w % i == 0) {
      Ans += m - i;
      for (int j = i * 2; j < m; j *= 2) Ans += m - j;
      if (w / i != i) {
        Ans += m - (w / i);
        for (int j = w / i * 2; j < m; j *= 2) Ans += m - j;
      }
    }
  }
  printf("%I64d", Ans);
  return 0;
}
