#Lutece1814. Montage

Montage

Migrated from Lutece 1814 Montage

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Today, Alice and Bob are playing a game described as follow:

  • Firstly, both of them choose a string consisting of only lower case letter, let the string given by Alice be A, and the string given by Bob be B.
  • Then, they concatenate a non-empty suffix of B to a non-empty prefix of A to form a new string C. For example, If A is "shinji"(quotes just for clarification), and B is "asuka", then they can use "shin", a non-empty prefix of A, and "suka", a non-empty suffix of B, to form a new string C : "shinsuka".

Your task is to count there are how many different strings that Alice and Bob can form.

Input

Two strings consisting of only lower case letters: A and B. (1length(A),length(B)1051 \le length (A), length(B) \le 10^5)

Output

An integer, representing the number of different strings Alice and Bob can form.
结果超过2322^{32} 请使用long long计算和存储
结果超过2322^{32} 请使用long long计算和存储
结果超过2322^{32} 请使用long long计算和存储
请用scanf("%s",s)或cin输入 请不要使用getchar和getline!!!
请用scanf("%s",s)或cin输入 请不要使用getchar和getline!!!
请用scanf("%s",s)或cin输入 请不要使用getchar和getline!!!

Samples

yep pie
8
shinji asuka
30