def main(): import sys from collections import defaultdict N, A, B = map(int, sys.stdin.readline().split()) S = sys.stdin.readline().strip() # Parse the string into runs of 'con's runs = [] i = 0 while i <= len(S) - 3: if S[i:i+3] == 'con': count = 1 j = i + 3 while j <= len(S) - 3 and S[j:j+3] == 'con': count += 1 j += 3 runs.append(count) i = j else: i += 1 # Build the frequency map freq = defaultdict(int) for run in runs: freq[run] += 1 operation_count = 0 step = 1 while True: target = A if step % 2 == 1 else B # Find the first run >= target found = False for k in list(freq.keys()): if k >= target: # Process this run freq[k] -= 1 if freq[k] == 0: del freq[k] operation_count += 1 # Split into target and (k - target) remaining = k - target if remaining > 0: freq[remaining] += 1 found = True break if not found: break step += 1 print(operation_count) if __name__ == '__main__': main()