def take_characters(s: str, k: int) -> int:
if k == 0 : return 0
count = Counter({"a": 0, "b": 0, "c": 0})
for char in s:
count[char] += 1
if min(count.values()) < k:
return -1
max_window = 0
left = 0
for right in range(len(s)):
count[s[right]] -= 1
while left <= right and min(count.values()) < k:
count[s[left]] += 1
left += 1
max_window = max(max_window, right - left + 1)
return len(s) - max_window