#include <iostream>
using namespace std;
int getCount(int arr[],int n,int k){
int count=0;
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(abs(arr[i]+arr[j])+abs(arr[i]-arr[j])==k){
count++;
}
}
}
return count;
}
int main() {
// your code goes here
int arr[]={1,4,-2,1};
int n=sizeof(arr)/sizeof(arr[0]);
int k;
cin>>k;
cout<<"The count of intersecting pairs are:"<<getCount(arr,n,k);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgZ2V0Q291bnQoaW50IGFycltdLGludCBuLGludCBrKXsKCWludCBjb3VudD0wOwoJZm9yKGludCBpPTA7aTxuO2krKyl7CgkJZm9yKGludCBqPWkrMTtqPG47aisrKXsKCQkJaWYoYWJzKGFycltpXSthcnJbal0pK2FicyhhcnJbaV0tYXJyW2pdKT09ayl7CgkJCQljb3VudCsrOwoJCQl9CgkJfQoJfQoJcmV0dXJuIGNvdW50Owp9CgppbnQgbWFpbigpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCWludCBhcnJbXT17MSw0LC0yLDF9OwoJaW50IG49c2l6ZW9mKGFycikvc2l6ZW9mKGFyclswXSk7CglpbnQgazsKCWNpbj4+azsKCWNvdXQ8PCJUaGUgY291bnQgb2YgaW50ZXJzZWN0aW5nIHBhaXJzIGFyZToiPDxnZXRDb3VudChhcnIsbixrKTsKCXJldHVybiAwOwp9