import re text = input('>').split() target = re.compile('[ЖжШшЩщЧч]') total = 0 words = [] for word in text: count_math = len(target.findall(word)) if count_math: total += count_math words.append(word) print(f'найдено шипящих: {total}') print('слова:') print(words)