The Strings
You are given an integer . You are also given four strings , , , of lengths consisting of lowercase English letters (from "a
" to "z
").
In one operation, you can choose any of these strings and change any character of it to any lowercase English letter. You need to find the minimum number of operations you need to do to divide the given strings into two pairs of equal strings that are different from each other. In other words, it needs to become possible to swap all the strings between each other in such a way that the condition holds.
Input
The first line contains an integer number — the lengths of the strings.
In the next four lines, there are four strings, one string per line: , , , and . All the strings have equal lengths of , and all the strings consist of lowercase English letters.
Output
In the only line, you have to output the minimum number of operations you need to do to satisfy the given conditions.
Examples
Note
In the first example, you can choose the second string and perform these operations:
changing the first character to "
e
";the second one to "
r
";the third one to "
e
".
After performing these operations, we achieve the second string equal to the third one. Note that the first and last strings are already equal. So after these operations, we achieve what we need. It can be proved that you can not do it in or fewer operations.
Scoring
( points): ;
( points): ;
( points): ;
( points): ;
( points): no additional constraints.