Toggle navigation
YouTube
Facebook
Telegram
english
english
українська
Algotester 4.3
Build 496
2024-10-17
Log In
Contact Us
College
Sponsors
Donate
Sources
Python 3
s = input() s = input() l = [0] * 256 for c in s: l[ord(c)] +=1 if l[ord('k')] > 0 and l[ord('a')] > 0: print(min(l[ord('k')] - 1, (l[ord('a')] - 1) // 2, l[ord('n')], l[ord('p')])) else: print(0)