This time the Berland Team Olympiad in Informatics is held in a remote city that can only be reached by one small bus. Bus has *n* passenger seats, seat *i* can be occupied only by a participant from the city *a*<sub class="lower-index">*i*</sub>.

Today the bus has completed *m* trips, each time bringing *n* participants. The participants were then aligned in one line in the order they arrived, with people from the same bus standing in the order of their seats (i. e. if we write down the cities where the participants came from, we get the sequence *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> repeated *m* times).

After that some teams were formed, each consisting of *k* participants form the same city standing next to each other in the line. Once formed, teams left the line. The teams were formed until there were no *k* neighboring participants from the same city.

Help the organizers determine how many participants have left in the line after that process ended. We can prove that answer doesn't depend on the order in which teams were selected.
The first line contains three integers *n*, *k* and *m* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>, 2 ≤ *k* ≤ 10<sup class="upper-index">9</sup>, 1 ≤ *m* ≤ 10<sup class="upper-index">9</sup>).

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>), where *a*<sub class="lower-index">*i*</sub> is the number of city, person from which must take seat *i* in the bus.
In the second example, the line consists of ten participants from the same city. Nine of them will form a team. At the end, only one participant will stay in the line.
4 2 5
1 2 3 1
12
1 9 10
1
1
3 2 10
1 2 1
0
1 10 10
1
0
1 1000000000 1000000000
100000
0
2 4 1
1 1
2
5 3 2
1 1 2 1 1
7
5 3 3
1 2 2 1 1
0
10 5 1000000000
1 1 1 2 2 1 2 2 2 2
10000000000
5 2 4
1 2 3 2 1
0
print("_RANDOM_GUESS_1691764803.0574088")# 1691764803.0574262