/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 200 点
問題文
高橋君はレストランのホールスタッフとして働いています。今日は N 人のお客さんからそれぞれ 1 つずつ料理の注文を受けました。
i 番目 (1 \leq i \leq N) のお客さんが実際に注文した料理名は T_i ですが、高橋君がキッチンに伝えた料理名は S_i でした。聞き間違いや伝え間違いがあったかもしれないので、高橋君は確認することにしました。
実際の注文 T_i とキッチンへの伝達 S_i が異なるお客さん、すなわち注文を間違えて伝えてしまったお客さんの人数を求めてください。
制約
- 1 \leq N \leq 10^5
- N は整数である。
- T_i および S_i は英小文字からなる長さ 1 以上 20 以下の文字列である。
入力
N T_1 S_1 T_2 S_2 \vdots T_N S_N
1 行目にはお客さんの人数を表す整数 N が与えられる。続く N 行のうち i (1 \leq i \leq N) 番目の行には、i 番目のお客さんの実際の注文 T_i とキッチンへの伝達 S_i がスペース区切りで与えられる。
出力
注文を間違えて伝えてしまったお客さんの人数を 1 行で出力せよ。
入力例 1
4 ramen ramen sushi susi curry curry pasta pizza
出力例 1
2
入力例 2
3 tea tea cake cake salad salad
出力例 2
0
入力例 3
10 ramen ramen sushi sushi pizza piza burger burger salad salad omelet omelette steak steak pasta pasta soup soap juice juice
出力例 3
3
入力例 4
20 ramen ramen sushi sushi curry curry pasta pasta salad salsa burger buger steak steak soup soup juice joice coffee coffee tea tea cake cake icecream icecream sandwich sandwitch dumpling dumpling noodle noodel omelet omelet pancake pancake chicken chicken fish dish
出力例 4
6
入力例 5
1 aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbb
出力例 5
1
Score : 200 pts
Problem Statement
Takahashi works as a floor staff member at a restaurant. Today, he received exactly one dish order from each of N customers.
The dish that the i-th (1 \leq i \leq N) customer actually ordered is T_i, but the dish name that Takahashi relayed to the kitchen was S_i. Since there may have been mishearings or miscommunications, Takahashi decided to verify the orders.
Find the number of customers for whom the actual order T_i and the relayed order S_i differ, that is, the number of customers whose orders were incorrectly communicated.
Constraints
- 1 \leq N \leq 10^5
- N is an integer.
- T_i and S_i are strings of lowercase English letters with length between 1 and 20, inclusive.
Input
N T_1 S_1 T_2 S_2 \vdots T_N S_N
The first line contains an integer N representing the number of customers. The i-th (1 \leq i \leq N) of the following N lines contains the actual order T_i and the relayed order S_i for the i-th customer, separated by a space.
Output
Print the number of customers whose orders were incorrectly communicated, on a single line.
Sample Input 1
4 ramen ramen sushi susi curry curry pasta pizza
Sample Output 1
2
Sample Input 2
3 tea tea cake cake salad salad
Sample Output 2
0
Sample Input 3
10 ramen ramen sushi sushi pizza piza burger burger salad salad omelet omelette steak steak pasta pasta soup soap juice juice
Sample Output 3
3
Sample Input 4
20 ramen ramen sushi sushi curry curry pasta pasta salad salsa burger buger steak steak soup soup juice joice coffee coffee tea tea cake cake icecream icecream sandwich sandwitch dumpling dumpling noodle noodel omelet omelet pancake pancake chicken chicken fish dish
Sample Output 4
6
Sample Input 5
1 aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbb
Sample Output 5
1