CF-165

 avatar
kaziamir
c_cpp
a year ago
657 B
2
Indexable
Never
#include<bits/stdc++.h>
using namespace std;

typedef struct point{
    int x;
    int y;
}point;

int main(){
    int n;
    cin>>n;
    point co[n];
    for(int i=0;i<n;i++){
        cin>>co->x>>co->y;
    }
    int sup = 0;
    for(int i=0;i<n;i++){
        int ct = 0;
        for(int j=0;j<n;j++){
                if(i!=j){
            if(co[i].x>co[j].x && co[i].y==co[j].y) ct++;
            if(co[i].x<co[j].x && co[i].y==co[j].y) ct++;
            if(co[i].x==co[j].x && co[i].y<co[j].y) ct++;
            if(co[i].x==co[j].x && co[i].y>co[j].y) ct++;
                }
        }
        if(ct>=4) sup++;
    }
    cout<<sup<<endl;
    return 0;
}