#abc350b. B - Dentist Aoki
B - Dentist Aoki
Score: points
问题陈述
高桥有 颗牙齿,每颗牙齿都位于编号为 的洞中。 牙医青木将对这些牙齿和洞进行 次治疗。 在第 次治疗中,将对洞 进行以下操作:
- 如果洞 中有牙齿,则从洞 中移除牙齿。
- 如果洞 中没有牙齿(即,洞是空的),则在洞 中长出一颗牙齿。
所有治疗完成后,高桥有多少颗牙齿?
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
Takahashi has teeth, one in each of the holes numbered .
Dentist Aoki will perform treatments on these teeth and holes.
In the -th treatment, hole is treated as follows:
- If there is a tooth in hole , remove the tooth from hole .
- If there is no tooth in hole (i.e., the hole is empty), grow a tooth in hole .
After all treatments are completed, how many teeth does Takahashi have?
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
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 teeth, and Aoki performs six treatments.
- In the first treatment, hole is treated. There is a tooth in hole , so it is removed.
- In the second treatment, hole is treated. There is a tooth in hole , so it is removed.
- In the third treatment, hole is treated. There is a tooth in hole , so it is removed.
- In the fourth treatment, hole is treated. There is a tooth in hole , so it is removed.
- In the fifth treatment, hole is treated. There is no tooth in hole , so a tooth is grown.
- In the sixth treatment, hole is treated. There is no tooth in hole , so a tooth is grown.
The final count of teeth is .
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