#agc006a. [agc006_a]Prefix and Suffix

[agc006_a]Prefix and Suffix

Problem Statement

Snuke is interested in strings that satisfy the following conditions:

  • The length of the string is at least NN.
  • The first NN characters equal to the string ss.
  • The last NN characters equal to the string tt.

Find the length of the shortest string that satisfies the conditions.

Constraints

  • 1N1001≤N≤100
  • The lengths of ss and tt are both NN.
  • ss and tt consist of lowercase English letters.

Input

The input is given from Standard Input in the following format:

NN ss tt

Output

Print the length of the shortest string that satisfies the conditions.


Sample Input 1

3
abc
cde

Sample Output 1

5

The shortest string is abcde.


Sample Input 2

1
a
z

Sample Output 2

2

The shortest string is az.


Sample Input 3

4
expr
expr

Sample Output 3

4

The shortest string is expr.