#include <bits/stdc++.h>
//#define D
using namespace std;
int main(){
    int n, k;
    cin >> n >> k;
    vector<int> o; int tmp;
    for(int i = 0; i < n; i++){
        cin >> tmp;
        o.push_back(tmp);
    }
    unsigned long long sum = 0;
    int a;
    for(int i = 0; i < n; i++){
#ifdef D
        cout << i << ": " << o[i] << '\n';
#endif
        a = o[i];
        for(int j = i; j < n; j++){
#ifdef D
            cout << '\t' << j << ": " << o[j] << '\n';
#endif
            a |= o[j];
            if(a >= k){
                sum += n-j;
#ifdef D
                cout << "\t\t" << n-j << '\n';
#endif
                break;
            }
        }
    }
    cout << sum;
    return 0;
}
