import sys,random,bisect from collections import deque,defaultdict,Counter from heapq import heapify,heappop,heappush from itertools import cycle, permutations from math import log,gcd input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) N,X,Y = mi() S = input() A = [] i = 0 while i < N: if S[i:i+3]=="con": a = 1 j = i+3 while j+2 < len(S): if S[j:j+3]=="con": a += 1 j += 3 else: break A.append(a) i = j else: i += 1 res = 0 dp = [-1] * ((N//3)*2+10) dp[0] = 0 for a in A: ndp = [-1] * ((N//3)*2) for s in range(-N//3,N//3+1): if dp[s] == -1: continue t = dp[s] for k in range(a//X+1): x = k y = (a-k*X)//Y ndp[s+x-y] = max(ndp[s+x-y],t+x+y) dp = ndp for s in range(-N//3,2): if dp[s]!=-1: if s <= 0: tmp = dp[s] + s else: tmp = dp[s] res = max(res,tmp) print(res)