You are given a log file in the form of a single string S of length N. You are also given Q queries. There are two types of queries:
Input format
Output format
For the query of type 1, you are required to print the count of occurrences of string S in a new line.4.
Constraints
1≤N,Q≤1051≤L≤R≤N|W|≤NS contains lower case alphabetsSum of lengths of W≤105
Log String = abbabababa "bab" string matches with [3,5] , [5,7] , [7,9] substrings of original log string. After second type of query , Log String = ababaababa "bab" string matches with [2,4] , [7,9] substrings of log string.