Michael the Kid got a game set from his grandparent as a birthday gift. The box holds n tiling blocks, and every block has the shape below.

Figure 1: a tiling block with parameters (3,2).
Every block carries two parameters (ℓ,m). The upper face has ℓ protruding knobs on the left and m protruding knobs in the middle, and the bottom face is carved with ℓ dens on the left and m dens in the middle at the matching spots.
An (ℓ,m) block clearly sits on another (ℓ,m) block, and that is not the only legal placement. An (ℓ,m) block can be tiled upon an (ℓ′,m′) block if and only if ℓ≥ℓ′ and m≥m′.
You are given a box B={b1,b2,…,bn} of n blocks, where block bi has parameters (ℓi,mi). Report how many blocks the tallest tower built from B contains.
The input lists several game boxes back to back. Each box starts with the integer n, the number of blocks inside it. The next n lines each hold two integers, the left parameter ℓi and the middle parameter mi of the i-th block.
n is at most 10000, and ℓi and mi lie between 1 and 100. A value of n=0 marks the end of the input.
For each box, print on its own line how many blocks the tallest tower built from that box contains. After the last box, print a single star * on a line of its own.