Non-Attacking Knights
Time limit1sMemory limit128 MB
Place the most knights on a board with blocked squares so no two attack each other.
Problem
You are given an chessboard from which some squares have been removed. Determine the maximum number of chess knights that can be placed on the remaining squares so that no two knights attack each other.

Figure 1: a knight placed on square S attacks the squares marked with x.
Write a program that:
- reads the description of the board together with its removed squares from standard input,
- computes the maximum number of mutually non-attacking knights that can be placed on the board,
- writes the result to standard output.
Input
The first line contains two integers and , where and . Here is the size of the board and is the number of removed squares.
Each of the next lines contains a pair of integers and () separated by a single space, giving the coordinates of a removed square. The top-left corner of the board has coordinates and the bottom-right corner has coordinates . No square is listed more than once.
Output
Print exactly one line containing a single integer: the maximum number of mutually non-attacking knights that can be placed on the given board.