#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <cassert>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
#include <iomanip>
#include <fstream>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;
typedef long long ll;
typedef pair<int,int> pii;

int num[101];
int main() {
  int n, S;
  while(cin >> n >> S,n||S) {
    memset(num,0,sizeof(num));
    REP(i,n) {
      int r;
      cin >> r;
      num[r]++;
    }
    int res = 0;
    REP(i,101) {
      REP(j,i+1) {
        if (i+j > S) {
          if (i==j) res += (num[i] - 1) * num[i] / 2;
          else res += num[i] * num[j];
        }
      }
    }
    cout << res << endl;
  }
}