Count Idle Warehouse Robots
The Banana Company employs small, autonomous transport units, known as "Bananaer", to efficiently carry large stacks of products within its warehouses. These Bananaer navigate along predefined paths in a warehouse, which can be represented as a Cartesian plane. Each Bananaer is stationed at distinct integral coordinate points of the form (x, y).
When a product needs to be delivered to a specific location (i, j), the system selects the nearest available Bananaer to complete the task. However, some Bananaers may seldom be chosen due to being surrounded by other units.
A Bananaer is considered idle if it has another Bananaer positioned directly above, below, to the left, and to the right of it. This means it is entirely enclosed and less likely to be selected for work. It is guaranteed that no two Bananaers share the same coordinates.
Given the locations of n Bananaers on the Cartesian plane, determine how many Bananers are idle based on the above criteria.
1Example 1

2Example 2

Constraints
Limits and guarantees your solution can rely on.
1 ≤ n ≤ 105-109 ≤ x[i], y[i] ≤ 109