#abc307h. [abc307_h]Marquee

[abc307_h]Marquee

Problem Statement

There is a length LL string SS consisting of uppercase and lowercase English letters displayed on an electronic bulletin board with a width of WW. The string SS scrolls from right to left by a width of one character at a time.

The display repeats a cycle of L+W1L+W-1 states, with the first character of SS appearing from the right edge when the last character of SS disappears from the left edge.

For example, when W=5W=5 and S=S= ABC, the board displays the following seven states in a loop:

  • ABC..
  • BC...
  • C....
  • ....A
  • ...AB
  • ..ABC
  • .ABC.

(. represents a position where no character is displayed.)

More precisely, there are distinct states for k=0,ldots,L+W2k=0,\\ldots,L+W-2 in which the display is as follows.

  • Let f(x)f(x) be the remainder when xx is divided by L+W1L+W-1. The (i+1)(i+1)-th position from the left of the board displays the (f(i+k)+1)(f(i+k)+1)-th character of SS when f(i+k)<Lf(i+k)<L, and nothing otherwise.

You are given a length WW string PP consisting of uppercase English letters, lowercase English letters, ., and _.
Find the number of states among the L+W1L+W-1 states of the board that coincide PP except for the positions with _.
More precisely, find the number of states that satisfy the following condition.

  • For every i=1,ldots,Wi=1,\\ldots,W, one of the following holds.
    • The ii-th character of PP is _.
    • The character displayed at the ii-th position from the left of the board is equal to the ii-th character of PP.
    • Nothing is displayed at the ii-th position from the left of the board, and the ii-th character of PP is ..

Constraints

  • 1leqLleqWleq3times1051 \\leq L \\leq W \\leq 3\\times 10^5
  • LL and WW are integers.
  • SS is a string of length LL consisting of uppercase and lowercase English letters.
  • PP is a string of length WW consisting of uppercase and lowercase English letters, ., and _.

Input

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

LL WW SS PP

Output

Print the answer.


Sample Input 1

3 5
ABC
..___

Sample Output 1

3

There are three desired states, where the board displays ....A, ...AB, ..ABC.


Sample Input 2

11 15
abracadabra
__.._________ab

Sample Output 2

2

Sample Input 3

20 30
abaababbbabaabababba
__a____b_____a________________

Sample Output 3

2

Sample Input 4

1 1
a
_

Sample Output 4

1