#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 29;
int a[100010];
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
vector<int> e;
set<long long> S;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    a[i]--;
  }
  int g = a[0];
  for (int i = 1; i < n; i++) g = gcd(g, a[i]);
  for (int i = 1; i * i <= g; i++) {
    if (g % i == 0) {
      e.push_back(i);
      if (g / i != i) e.push_back(g / i);
    }
  }
  long long ans = 0;
  for (int i = 0; i < (int)e.size(); i++) {
    for (long long j = e[i]; j <= m; j *= 2) {
      if (S.find(j) == S.end()) {
        S.insert(j);
        ans += m - j;
      }
    }
  }
  printf("%I64d\n", ans);
}
