

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
高橋君には、穴 に 本ずつ、全部で 本の歯が生えています。
歯医者の青木君は、これらの歯と穴に対して、 回の治療を行います。
回目の治療では、穴 を治療します。治療内容は次の通りです。
- 穴 に歯が生えている場合、穴 から歯を抜く。
- そうでない ( 穴 に歯が生えていない) 場合、穴 に歯を生やす。
全ての治療が終わった後、高橋君に生えている歯の本数は何本ですか?
制約
- 入力は全て整数
入力
入力は以下の形式で標準入力から与えられる。
出力
答えを整数として出力せよ。
入力例 1Copy
30 6 2 9 18 27 18 9
出力例 1Copy
28
高橋君には最初 本の歯が生えており、青木君は 回の治療を行います。
- 回目の治療では穴 を治療します。 穴 に歯が生えているため、歯を抜きます。
- 回目の治療では穴 を治療します。 穴 に歯が生えているため、歯を抜きます。
- 回目の治療では穴 を治療します。 穴 に歯が生えているため、歯を抜きます。
- 回目の治療では穴 を治療します。 穴 に歯が生えているため、歯を抜きます。
- 回目の治療では穴 を治療します。 穴 に歯が生えていないため、歯を生やします。
- 回目の治療では穴 を治療します。 穴 に歯が生えていないため、歯を生やします。
最終的な歯の本数は 本です。
入力例 2Copy
1 7 1 1 1 1 1 1 1
出力例 2Copy
0
入力例 3Copy
9 20 9 5 1 2 2 2 8 9 2 1 6 2 6 5 8 7 8 5 9 8
出力例 3Copy
5
Score: points
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 1Copy
30 6 2 9 18 27 18 9
Sample Output 1Copy
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 2Copy
1 7 1 1 1 1 1 1 1
Sample Output 2Copy
0
Sample Input 3Copy
9 20 9 5 1 2 2 2 8 9 2 1 6 2 6 5 8 7 8 5 9 8
Sample Output 3Copy
5