#include<bits/stdc++.h>
using namespace std;
std::map<int,int> a;
int cnt;
int main(){
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++){
int t;
cin>>t;
for(int i=t;i<=t+m-1;i++){
a[i]+=1;
}
}
std::map<int,int>::iterator pp=a.begin();
for(;pp!=a.end();++pp){
if(pp->second==1){
cnt++;
}
}
cout<<cnt;
}