#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return b ? gcd(b, a % b) : a;
}
int main() {
  unsigned long long d, n, m;
  cin >> n >> m;
  cin >> d;
  d--;
  for (int i = 1; i < n; i++) {
    unsigned long long tmp;
    cin >> tmp;
    tmp = tmp - 1;
    d = gcd(d, tmp);
  }
  unsigned long long ans = 0;
  for (unsigned long long i = 1; i * i <= d; i++) {
    if (d % i == 0) {
      if (i % 2 == 1) {
        for (unsigned long long j = i; j <= m; j *= 2) {
          ans += m - j;
        }
      }
      if (d / i % 2 == 1 && i * i != d) {
        for (unsigned long long j = d / i; j <= m; j *= 2) {
          ans += m - j;
        }
      }
    }
  }
  cout << ans << endl;
}
