#abc350b. B - Dentist Aoki

B - Dentist Aoki

Score: 200200 points

问题陈述

高桥有 NN 颗牙齿,每颗牙齿都位于编号为 1,2,,N1, 2, \dots, N 的洞中。 牙医青木将对这些牙齿和洞进行 QQ 次治疗。 在第 ii 次治疗中,将对洞 TiT_i 进行以下操作:

  • 如果洞 TiT_i 中有牙齿,则从洞 TiT_i 中移除牙齿。
  • 如果洞 TiT_i 中没有牙齿(即,洞是空的),则在洞 TiT_i 中长出一颗牙齿。

所有治疗完成后,高桥有多少颗牙齿?

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

Takahashi has NN teeth, one in each of the holes numbered 1,2,,N1, 2, \dots, N.
Dentist Aoki will perform QQ treatments on these teeth and holes.
In the ii-th treatment, hole TiT_i is treated as follows:

  • If there is a tooth in hole TiT_i, remove the tooth from hole TiT_i.
  • If there is no tooth in hole TiT_i (i.e., the hole is empty), grow a tooth in hole TiT_i.

After all treatments are completed, how many teeth does Takahashi have?

Constraints

  • All input values are integers.
  • 1N,Q10001 \le N, Q \le 1000
  • 1TiN1 \le T_i \le N

Input

The input is given from Standard Input in the following format:

NN QQ

T1T_1 T2T_2 \dots TQT_Q

Output

Print the number of teeth as an integer.

Sample Input 1

30 6
2 9 18 27 18 9

Sample Output 1

28

Initially, Takahashi has 3030 teeth, and Aoki performs six treatments.

  • In the first treatment, hole 22 is treated. There is a tooth in hole 22, so it is removed.
  • In the second treatment, hole 99 is treated. There is a tooth in hole 99, so it is removed.
  • In the third treatment, hole 1818 is treated. There is a tooth in hole 1818, so it is removed.
  • In the fourth treatment, hole 2727 is treated. There is a tooth in hole 2727, so it is removed.
  • In the fifth treatment, hole 1818 is treated. There is no tooth in hole 1818, so a tooth is grown.
  • In the sixth treatment, hole 99 is treated. There is no tooth in hole 99, so a tooth is grown.

The final count of teeth is 2828.

Sample Input 2

1 7
1 1 1 1 1 1 1

Sample Output 2

0

Sample Input 3

9 20
9 5 1 2 2 2 8 9 2 1 6 2 6 5 8 7 8 5 9 8

Sample Output 3

5