Skip to content
UPEEC

Count Occurrences

Easy#strings· solved by 0 · time limit 2.0 s

Count how many times pattern pp occurs in text tt, overlaps included (aa occurs 3 times in aaaa).

Input

Line 1: text tt. Line 2: pattern pp.

Output

The count.

Constraints

1≤∣p∣≤∣t∣≤50001 \le |p| \le |t| \le 5000, lowercase letters.

Sample 1

Input

aaaa
aa

Output

3

Sample 2

Input

banana
ana

Output

2

Sign in or join free to run and submit your solution.