Christmas Garland

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

Once upon a time, Nikita was relaxing at home and watching a Christmas garland. The light bulbs were flickering following some strange pattern.

Let us formalize the garland's description. It consists of nn colored light bulbs. Every light bulb is either on or off at any moment. Initially, all of them are off.

Sometimes all light bulbs of one color change their states to the opposite. After each such change, Nikita wants to know the number of maximal non-empty continuous segments of lit bulbs. A lit segment is maximal if it is not contained in any other lit segment.

입력

The first line contains integers nn, kk and qq: the number of light bulbs, the number of different colors and the number of changes of the garland (1n,q21051 \le n, q \le 2 \cdot 10^5, 1kn1 \le k \le n).

The second line contains nn integers c_1,c_2,,c_nc\_1, c\_2, \ldots, c\_n: the colors of light bulbs in the garland (1c_ik1 \le c\_i \le k).

Next qq lines describe changes of the garland in the order they happened. Each of these lines contains an integer d_id\_i, the color of light bulbs which have just changed their states (1d_ik1 \le d\_i \le k).

출력

The output must contain qq lines. The ii-th line must contain one integer: the number of maximal continuous segments of lit bulbs after ii-th change.