a = input().split()
counter = 0
for i in range(len(a)):
if a[i][-1].isalpha():
if a[i][-2::] == 'но':
counter += 1
else:
if a[i][-3:-1] == 'но':
print(len(a))
print(counter)
text = input().split()
print(len(text)) # кол-во слов
print(sum([1 for word in text if 'но' in word])) # слова на 'но'
a = input().split()
counter = 0
for i in range(len(a)):
if a[i][-1].isalpha():
if a[i][-2::] == 'но':
counter += 1
else:
if a[i][-3:-1] == 'но':
counter += 1
print(len(a))
print(counter)
text = input().split()
print(len(text)) # кол-во слов
print(sum([1 for word in text if 'но' in word])) # слова на 'но'