def preprocess(s): runs = [] n = len(s) i = 0 while i < n: if i <= n - 3 and s[i] == 'c' and s[i+1] == 'o' and s[i+2] == 'n': count = 0 j = i while j <= n - 3 and s[j] == 'c' and s[j+1] == 'o' and s[j+2] == 'n': count += 1 j += 3 runs.append(('con', count)) i = j else: runs.append(('other', 1)) i += 1 return runs def main(): import sys input = sys.stdin.read().split() idx = 0 N = int(input[idx]) idx +=1 A = int(input[idx]) idx +=1 B = int(input[idx]) idx +=1 S = input[idx] idx +=1 runs = preprocess(S) operations = 0 step = 1 while True: K = A if (step % 2 == 1) else B found = False for i in range(len(runs)): typ, cnt = runs[i] if typ == 'con' and cnt >= K: # Replace this run runs.pop(i) # Insert 'other' run of 4 runs.insert(i, ('other', 4)) if cnt > K: # Insert remaining 'con' run runs.insert(i+1, ('con', cnt - K)) operations += 1 found = True break if not found: break step += 1 print(operations) if __name__ == "__main__": main()