n = int(input())
for i in range(n):
# s : 입력할 단어, p : 복붙한 단어
s,p = input().split()
# 복분한 단어가 몇 번 나오는지 count변수에 저장
count = s.count(p)
# count로 복붙한 단어를 계산했기 때문에 제거
s = s.replace(p,'')
# 결과 출력
print(count + len(s))
'백준' 카테고리의 다른 글
백준 10815번: 숫자 카드 (파이썬) (0) | 2023.07.28 |
---|---|
백준 11004번: K번째 수 (파이썬) (0) | 2023.07.28 |
백준 11650번: 좌표 정렬하기 (파이썬) (0) | 2023.07.28 |
백준 11651번: 좌표 정렬하기 2 (파이썬) (0) | 2023.07.28 |
백준 11866번: 요세푸스 문제 0 (파이썬) (0) | 2023.07.28 |