#SDNU1714. Unvarnished Report
Unvarnished Report
Problem Statement
KEYENCE has a culture of reporting things as they are, whether good or bad.
So we want to check whether the reported content is exactly the same as the original text.
You are given two strings and , consisting of lowercase English letters.
If and are equal, print ; otherwise, print the position of the first character where they differ.
Here, if the -th character exists in only one of and , consider that the -th characters are different.
More precisely, if and are not equal, print the smallest integer satisfying one of the following conditions:
- , , and .
- .
- .
Here, and denote the lengths of and , respectively, and and denote the -th characters of and , respectively.
Constraints
- and are strings of length between and , inclusive, consisting of lowercase English letters.
Input
The input is given from Standard Input in the following format:
Output
If and are equal, print ; otherwise, print the position of the first character where they differ.
Sample Input 1
abcde
abedc
Sample Output 1
3
We have abcde
and abedc
.
and have the same first and second characters, but differ at the third character, so print .
Sample Input 2
abcde
abcdefg
Sample Output 2
6
We have abcde
and abcdefg
.
and are equal up to the fifth character, but only has a sixth character, so print .
Sample Input 3
keyence
keyence
Sample Output 3
0
and are equal, so print .
Related
In following contests: