407566: GYM102830 B Tryouts
Description
In an alternate universe without COVID, tryouts are taking place in person! Participants have come to the auditorium and have gotten seated and are ready to code.
The auditorium has a grid of chairs, with 26 rows and 26 columns. A seat can be identified by a pair of coordinates $$$(x, y)$$$, where $$$0 \le x, y \le 25$$$. Now, a student sitting in a seat would be considered surrounded if there are also students directly to his left, right, front and back. In our world, that would be really bad for socially distancing.
Determine how many students in this auditorium are surrounded, given all the students' coordinates!
InputThe first line of the input contains a single integer $$$n (1 \le n \le 500)$$$, the number of students in the auditorium.
The next $$$n$$$ lines each contain a coordinate $$$(x, y)$$$ of a single student.
OutputOutput a single integer, the number of students that are surrounded.
ExampleInput8 1 2 2 1 2 2 2 3 3 1 3 2 3 3 4 2Output
2