403158: GYM101055 A Anubis' Cannonballs

Memory Limit:64 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Anubis' Cannonballstime limit per test0.5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

Anubis is worried, french soldiers are practicing target shooting with cannonballs on the sphinxes again! This time he will try to stop that the other parts of the sphinx will have the same fate as its nose.

To stop the cannons, he can summon thunderbolts that destroy everything they touch, including cannonballs. But Egyptian gods do not have as much followers as they once had, and that limits their powers.

Anubis can only summon thunderbolts in a specific moment of time. Luckily, this moment is the same moment the cannonballs are in the air. Anubis will use this chance to destroy the maximum possible number of cannonballs.

To summon the bolts, Anubis needs to temporarily shift to our plane of existence. Therefore, he can only hit targets that are in the same plane.

Help Anubis destroy the greatest possible number of cannonballs.

Input

The first line has a single integer N, the number of cannonballs. Each of the next N lines has 3 integers xi, yi and zi, the position of the ith cannonball in the moment Anubis can summon the thunderbolts.

Limits

  • 1 ≤ N ≤ 50
  • |xi|, |yi|, |zi| ≤ 103
  • Two cannonballs can coincide
Output

Print a single integer, the greatest number of cannonballs Anubis can destroy.

ExamplesInput
3
0 0 0
0 0 0
0 0 0
Output
3
Input
3
0 0 0
1 1 1
2 2 2
Output
3
Input
4
1 0 0
0 1 0
0 0 1
1 1 1
Output
3

Source/Category

加入题单

算法标签: