You are given two strings s and p of lowercase letters. Count the number of start indices i (0-indexed) such that the substring of s beginning at i with length len(p) is a permutation of p — that is, it uses exactly the same multiset of letters as p.
Windows may overlap, and each qualifying start index is counted once. If len(p) > len(s), the answer is 0.
Input format
Line 1: the string s (lowercase letters, no spaces).
Line 2: the string p (lowercase letters, no spaces).
Output format
A single integer: the number of qualifying start indices.
Constraints
- 1 <= length of s <= 100000
- 1 <= length of p <= 100000
- both strings contain only the characters
a-z