n, A, B = map(int, input().split()) s = input().strip() runs = [] current_run = 0 i = 0 while i <= len(s) - 3: if s[i] == 'c' and s[i+1] == 'o' and s[i+2] == 'n': current_run += 1 i += 3 else: if current_run > 0: runs.append(current_run) current_run = 0 i += 1 if current_run > 0: runs.append(current_run) total_steps = 0 for m in runs: current = m steps = 0 turn = A while True: if current >= turn: steps += 1 current -= turn turn = B if turn == A else A else: break total_steps += steps print(total_steps)