#include<bits/stdc++.h>
using namespace std;
#define dy signed long long
#define sr cin>>
#define sc cout<<
dy n,k,p,y,b[102][2],x,ans;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
sr n>>k>>p;
for(dy i=1;i<=n;i++){
sr x>>y;
if(y<=p) b[x][1]++;
else b[x][2]++;
}
for(dy i=0;i<=100;i++){if((b[i][1]==1&&b[i][2]>=1)||b[i][1]>1){ans+=b[i][1]*(b[i][1]-1)/2+b[i][2]*b[i][1];}}
sc ans;
return 0;
}
都wa了