Please solve the programming task below using a self-contained code snippet in a markdown code block.

You are given an m x n binary matrix grid, where 0 represents a sea cell and 1 represents a land cell.
A move consists of walking from one land cell to another adjacent (4-directionally) land cell or walking off the boundary of the grid.
Return the number of land cells in grid for which we cannot walk off the boundary of the grid in any number of moves.
 
Please complete the following python code precisely:
```python
class Solution:
    def numEnclaves(self, grid: List[List[int]]) -> int:
```