package ncu.edu.ccf;
import java.util.Scanner;
public class HuiShouZhanXuanZhi {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] row = new int[n];//横坐标
int[] col = new int[n];//纵坐标
for(int i = 0; i<n; i++) {
row[i] = sc.nextInt();
col[i] = sc.nextInt();
}
int num0 = 0, num1 = 0, num2 = 0, num3 = 0, num4 = 0;
for(int i = 0; i<n; i++) {
if(search(row,col,row[i]-1,col[i])&&
search(row,col,row[i]+1,col[i])&&
search(row,col,row[i],col[i]-1)&&
search(row,col,row[i],col[i]+