TopCoder

User's AC Ratio

100.0% (5/5)

Submission's AC Ratio

83.3% (5/6)

Tags

Description

現在是暑假,閒閒沒事做的桃子開始亂敲鍵盤,打出了一個無意義的字串。

qwqq

他想要找到裡面有幾個 qwq,你可以幫他找出來嗎?

說明:裡面有 2 個 qwqqwqq、qwqq
只要組成字串的 index 組合不一樣,都要列入計數喔!

Input Format

輸入第一行有一個字串 P (len(P)=3)
輸入第二行有一個字串 S (1len(S)106)
字串內只會有小寫英文字母。

Output Format

輸出一個整數代表 PS 裡面出現了幾次(請參考題目敘述的說明)。

Sample Input 1

qwq
qwqq

Sample Output 1

2

Hints

Problem Source

CodeForces

Subtasks

No. Testdata Range Constraints Score
1 0 範例測資 0
2 0~12 無額外限制 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 524288 65536 1 2
1 1000 524288 65536 2
2 1000 524288 65536 2
3 1000 524288 65536 2
4 1000 524288 65536 2
5 1000 524288 65536 2
6 1000 524288 65536 2
7 1000 524288 65536 2
8 1000 524288 65536 2
9 1000 524288 65536 2
10 1000 524288 65536 2
11 1000 524288 65536 2
12 1000 524288 65536 2