#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int n, S;
int seq[300000];

int main() {
  while (scanf("%d %d", &n, &S), n|S) {
    REP(i, n) {
      scanf("%d", &seq[i]);
    }
    seq[n] = 1 << 30;
    sort(seq, seq + n);
    ll ans = 0;
    REP(i, n) {
      int v = S - seq[i];
      if (seq[i] * 2 > S) { ans--; }
      int ng = upper_bound(seq, seq + n, v) - seq;
      ans += n - ng;
    }
    ans /= 2;
    printf("%lld\n", ans);
  }
}