Time limit
2s
Memory limit
128 MB
Several points are placed on a circle at distinct integer angles. You want to paint some of these points red or blue.
The painted points must satisfy the following rule. There must be a rotation angle d such that rotating every red point by d degrees in the same direction makes the red points land exactly on the blue points. A point cannot be painted both colors.
Given the angles of the points on the circle, find the maximum number of points that can be painted while satisfying this rule.
The first line contains the number of points N on the circle. (1 <= N <= 360)
Each of the next N lines contains the angle of one point. Every angle is an integer from 0 to 359, and no angle appears more than once.
Print the maximum number of points that can be painted while satisfying the rule.