Sultan Al-Bandar, the ruler of the Old West Sumatra Sultanate, has decided to give his land to his only son. Although the Sultan believes his son would never misuse the land, he still has doubts about his son's ability to rule. So he decided to give his son a puzzle as a test.
On his land the Sultan drew an N×N grid (imaginary, of course) in which every pair of adjacent grid intersections is the same distance apart. He then placed some pillars on the land, each pillar standing on exactly one intersection, and summoned his son.
"My dear son, if you were to choose four of these pillars so that each one serves as a corner of a single region, how many different selections could you make?" asked the Sultan. His son answered with a broad smile. Remembering that his son works for the Sultanate's Advanced Combinatorial Ministry, the Sultan quickly added: "Ah — and every side of the region must be parallel to the grid lines I drew."
The Sultan had not actually worked out an answer himself; he asked on a whim after seeing that smile. Help him by writing a program that counts how many such selections are possible.
The input contains several test cases. Each case begins with two integers N (2≤N≤100), the grid size, and P (2≤P≤N2), the number of pillars. Rows and columns are numbered from 1 to N. Each of the next P lines contains two integers r and c (1≤r,c≤N), the row and column of a pillar.
The input is terminated by a line containing two zeros, which must not be processed.
For each test case, output a single line containing the number of ways to choose four pillars that form the corners of a region whose sides are parallel to the grid lines (that is, an axis-aligned rectangle).