from heapq import * n, a, b = map(int, input().split()) S = input() S = S.replace("con", "*") lst = [] row = 0 for s in S: if s == "*": row += 1 else: if row != 0: lst.append(row) row = 0 if row != 0: lst.append(row) lst.sort() tot = sum(lst) aa = 0 bb = 0 C = [] for l in lst: bb += l // b C.append((-(l % b), l)) heapify(C) def f(a, b): if a > b: return 2 * b + 1 else: return 2 * a ans = f(aa, bb) while C: _, d = heappop(C) if d < a: continue bb -= d // b d -= a aa += 1 bb += d // b heappush(C, (-(d % b), d)) ans = max(ans, f(aa, bb)) print(ans)