74. Mn, Mn + 1, ... Mn + M - 1

I'm a slow walker, but I never walk backwards.

Task Description

Write a program to count the number of integers which can be written as $M\cdot k, M\cdot k + 1,$ ... and $M\cdot k + M - 1$ respectively.

統計有多少整數被 $M$ 除餘 $0$、餘 $1$、...、餘 $M-1$。

Input format

The first line has the number of input integers $N$. Each of the following $N$ lines has an input integer. The last line has $M$.

  • $1\le M \le 200000$

Output format

the number of integers which can be written as $M\cdot k, M\cdot k + 1,$ ... and $M\cdot k + M - 1$.

Sample input 1

5
1
2
3
4
5
3

Sample output 1

1
2
2

Sample input 2

10
3
1
4
1
5
9
2
6
5
3
3

Sample output 2

4
3
3

Discussion