n,a,b=map(int,input().split()) N=n s=["#"]+list(input()) x=[] l=1 nod=["o","n","c"] while l<=n: if s[l]!="c":l+=1 else: r=l while r0:x.append(num) l=r+1 n=len(x) if n==0: print(0) exit() dp=[-2**60]*(N//3+10) dp[0]=0 for i in range(n): newdp=[-2**60]*(N//3+10) for j in range(len(dp)): if dp[j]<0:break for k in range(10**9): if a*k>x[i]:break newdp[j+k]=max(newdp[j+k],dp[j]+(x[i]-a*k)//b) dp=newdp[:] ans=0 for A in range(len(dp)): if A>dp[A]: ans=max(ans,2*dp[A]+1) else: ans=max(ans,2*A) print(ans)