using std::cout;
using std::endl;
using std::cin;
#include <vector>
using std::vector;
int main() {
int n, s, t, c = 0;
cin >> n >> s;
vector<int> ints;
while (cin >> t) ints.push_back(t);
for (vector<int>::iterator i = ints.begin(); i != ints.end(); ++i)
for (vector<int>::iterator j = i + 1; j != ints.end(); ++j)
if (*i + *j <= s) ++c;
cout << c << endl;
return 0;
}