P24427 [AtCoder] Extra Character
入门
题目描述

Problem Statement

You are given strings S and T. S consists of lowercase English letters, and T is obtained by inserting a lowercase English letter into S.
Find the position of the inserted character in T.
If there are multiple candidates, find any of them.

Input

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

Output

Print an integer i, representing that the inserted character is the i-th character from the beginning of T. If there are multiple possible answers, printing any of them is accepted.

Constraints

  • $1 \leq |S| \leq 5\times 10^5$
  • S consists of lowercase English letters.
  • T is obtained by inserting a lowercase English letter into S.

Sample Input 1

atcoder
atcorder

Sample Output 1

5

The 5-th character from the beginning of T, r, is inserted.

Sample Input 2

million
milllion

Sample Output 2

5

One of the 3-rd, 4-th, and 5-th characters from the beginning of T is inserted.
Thus, printing any one of 3, 4, and 5 is accepted.

Sample Input 3

vvwvw
vvvwvw

Sample Output 3

3

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
atcoder atcorder
样例输出
5