#include using namespace std; int main(){ int N, A, B; cin >> N >> A >> B; string S; cin >> S; vector C(1, 0); for (int i = 0; i <= N - 3; i++){ if (S.substr(i, 3) == "con"){ C.back()++; i += 2; } else if (C.back() != 0){ C.push_back(0); } } if (C.back() == 0){ C.pop_back(); } int cnt = C.size(); vector dp(1, 0); int N1 = 0; for (int i = 0; i < cnt; i++){ int N2 = C[i] / A; for (int j = 0; j < N2; j++){ dp.push_back(0); } for (int j = N1; j >= 0; j--){ for (int k = N2; k >= 0; k--){ dp[j + k] = max(dp[j + k], dp[j] + (C[i] - A * k) / B); } } N1 += N2; } int ans = 0; for (int i = 0; i < N1 + 1; i++){ if (dp[i] >= i - 1){ ans = max(ans, i); } } cout << ans << endl; }