

実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 100 点
問題文
正整数 N および、英小文字からなる長さ N の文字列 S,T が与えられます。
S と T のハミング距離を求めてください。 すなわち、1 以上 N 以下の整数 i であって、S の i 文字目と T の i 文字目が異なるようなものの個数を求めてください。
制約
- 1\leq N \leq 100
- N は整数
- S,T はそれぞれ英小文字からなる長さ N の文字列
入力
入力は以下の形式で標準入力から与えられる。
N S T
出力
答えを出力せよ。
入力例 1
6 abcarc agcahc
出力例 1
2
S と T は 2,5 文字目が異なり、それ以外が等しいです。よって答えは 2 です。
入力例 2
7 atcoder contest
出力例 2
7
入力例 3
8 chokudai chokudai
出力例 3
0
入力例 4
10 vexknuampx vzxikuamlx
出力例 4
4
Score : 100 points
Problem Statement
You are given a positive integer N and two strings S and T, each of length N and consisting of lowercase English letters.
Find the Hamming distance between S and T. That is, find the number of integers i such that 1 \leq i \leq N and the i-th character of S is different from the i-th character of T.
Constraints
- 1\leq N \leq 100
- N is an integer.
- Each of S and T is a string of length N consisting of lowercase English letters.
Input
The input is given from Standard Input in the following format:
N S T
Output
Print the answer.
Sample Input 1
6 abcarc agcahc
Sample Output 1
2
S and T differ in the 2nd and 5th characters, but not in other characters. Thus, the answer is 2.
Sample Input 2
7 atcoder contest
Sample Output 2
7
Sample Input 3
8 chokudai chokudai
Sample Output 3
0
Sample Input 4
10 vexknuampx vzxikuamlx
Sample Output 4
4