#include <bits/stdc++.h>
using namespace std;
const int N = 101010;
int n, m, c;
int a[N], b[N * 33];
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void gao(int x) {
  for (long long i = x; i < m; i *= 2) {
    b[++c] = i;
  }
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    int d = 0;
    for (int i = (1); i < (n + 1); i++) {
      scanf("%d", a + i);
      d = gcd(d, a[i] - 1);
    }
    c = 0;
    for (int i = 1; 1ll * i * i <= d; ++i)
      if (d % i == 0) {
        gao(i);
        if (i != d / i) gao(d / i);
      }
    sort(b + 1, b + 1 + c);
    c = unique(b + 1, b + 1 + c) - b - 1;
    long long ans = 0;
    for (int i = (1); i < (c + 1); i++) {
      ans += m - b[i];
    }
    printf("%lld\n", ans);
  }
  return 0;
}
