On a field of size $$$n \times n$$$, there is a chess knight. Some cells in the field have caught fire. The fire spreads to neighboring cells at the end of each knight's move, and if the knight is caught by the fire, it will burn. The fire cannot spread beyond the field boundaries, while the knight can escape.
Your task is to determine the number of starting positions for the knight from which it can escape the fire moving outside of the field boundaries.
The first line contains an integer $$$n$$$ ($$$1 \leq n \leq 500$$$).
Each of the following $$$n$$$ lines contains $$$n$$$ characters representing the initial state of the field. "#" indicates fire, while "." indicates an empty cell.
Output a single integer — the number of cells starting from which the knight can escape from the fire.
6 ###### ####.. ...#.. .##... ###### ######
10
A chess knight moves two squares horizontally and then one square vertically, or one square horizontally and then two squares vertically.
| Название |
|---|


