atcoder#NIKKEI2019QUALB. Touitsu
Touitsu
Score : points
Problem Statement
You are given three strings and . Each of these is a string of length consisting of lowercase English letters.
Our objective is to make all these three strings equal. For that, you can repeatedly perform the following operation:
- Operation: Choose one of the strings and , and specify an integer between and (inclusive). Change the -th character from the beginning of the chosen string to some other lowercase English letter.
What is the minimum number of operations required to achieve the objective?
Constraints
- Each of the strings and is a string of length .
- Each character in each of the strings and is a lowercase English letter.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum number of operations required.
4
west
east
wait
3
In this sample, initially west
、 east
、 wait
. We can achieve the objective in the minimum number of operations by performing three operations as follows:
- Change the second character in to
a
. is nowwast
. - Change the first character in to
w
. is nowwast
. - Change the third character in to
s
. is nowwast
.
9
different
different
different
0
If and are already equal in the beginning, the number of operations required is .
7
zenkoku
touitsu
program
13