You are given a string t, a prefix p, and a suffix s. You have to find the number of distinct substrings starting with the prefix p and ending with the suffix s.
There are three lines of input consisting of string t, prefix p, and suffix s. All the strings are lowercase Latin letters.
The only line of output is the number of distinct substrings starting with p and ending with s.
abcabc a bc
There are 3 substrings starting with a and ending with bc are abc, abc and abcabc. Among these abc and abcabc are distinct substring.
ababababa a b
abacbcdada a a