Subsequences Summing to Sevens#10596

Subsequences Summing to Sevens

1 second
128 megabytes
Very easy

Farmer John's cows are standing in a row, as they occasionally have a tendency to do. Each cow is labeled with a distinct integer ID number so that FJ can tell them apart. FJ would like to take a photo of a contiguous group of cows, but he only wants to photograph a group whose IDs sum to a multiple of .

Help FJ determine the size of the largest group he can photograph.

Input

The first line contains an integer n~(1 \le n \le 50000). Each of the next lines contains one integer representing a cow's \text{ID}~(0 \le \text{ID} \le 10^6).

Output

Print the number of cows in the largest contiguous group whose IDs sum to a multiple of . If no such group exists, print .

Examples

In this example, 5 + 1 + 6 + 2 + 14 = 28, which is a multiple of .

Example 1

Loading
Loading