#C2655. Count Differences in DNA Sequences

    ID: 45995 Type: Default 1000ms 256MiB

Count Differences in DNA Sequences

Count Differences in DNA Sequences

In this problem, you are given two DNA sequences A and B, each of length (N). Your task is to determine the number of positions at which the two sequences differ. Formally, you need to compute the number of indices (i) (where (1 \leq i \leq N)) such that (A_i \neq B_i).

For example, if (A = \texttt{ACGTT}) and (B = \texttt{ACGGT}), there is exactly 1 position where the characters differ.

inputFormat

The input is read from standard input (stdin) and consists of three lines:

1. The first line contains a single integer (N), the length of the DNA sequences.
2. The second line contains the DNA sequence (A) (a string of length (N)).
3. The third line contains the DNA sequence (B) (a string of length (N)).

outputFormat

Output to standard output (stdout) a single integer representing the number of positions at which the sequences (A) and (B) differ.## sample

5
ACGTT
ACGGT
1

</p>