#include <bits/stdc++.h>
using namespace std;
int arr[200010];
long long int a, b;
int n;
long long int T;
string s;
long long int check() {
  int cost = 1;
  if (s[0] == 'w') cost += b;
  int ans = 0;
  if (cost > T) return 0;
  ans = 1;
  for (int i = 2; i <= n; i++) {
    long long int newc = 0;
    if (arr[i] == arr[i - 1]) {
      newc = 1 + a;
    } else
      newc = 1 + a + b;
    if (newc + cost <= T) {
      ans++;
      cost += newc;
    } else
      break;
  }
  return ans;
}
int frb() {
  int ans = 0;
  long long int cost = a + 1;
  if (s[n - 1] == 'w') cost += b;
  if (cost > T)
    return 0;
  else
    ans = 1;
  for (int i = n - 1; i >= 1; i--) {
    long long int newc = 0;
    if (arr[i] == arr[i + 1]) {
      newc = 1 + a;
    } else
      newc = 1 + a + b;
    if (newc + cost <= T) {
      ans++;
      cost += newc;
    } else
      break;
  }
  return ans;
}
long long int fr[200010];
long long int br[200010];
int main() {
  cin >> n;
  cin >> a >> b >> T;
  cin >> s;
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == 'w')
      arr[i] = 1;
    else
      arr[i] = 0;
  }
  long long int res = check();
  long long int bcc = frb();
  int transit = 0;
  if (s[0] != s[n - 1]) transit = b;
  fr[0] = 0;
  fr[1] = 1;
  if (s[0] == 'w') fr[1] += b;
  for (int i = 2; i <= n; i++) {
    if (arr[i] == arr[i - 1]) {
      fr[i] = 1 + fr[i - 1];
    } else
      fr[i] = 1 + b + fr[i - 1];
  }
  br[n] = 1 + a + transit;
  for (int i = n - 1; i >= 1; i--) {
    br[i] = br[i + 1];
    if (arr[i] == arr[i + 1]) {
      br[i] += 1 + a;
    } else
      br[i] += 1 + a + b;
  }
  vector<long long int> back;
  for (int i = n; i >= 1; i--) {
    back.push_back(br[i]);
  }
  int ans1 = 0;
  for (int i = 0; i < n - 1; i++) {
    back.pop_back();
    long long int cost = fr[i + 1];
    long long int left = T - (cost + (i + 1) * a);
    if (left >= 0) {
      vector<long long int>::iterator it;
      it = lower_bound(back.begin(), back.end(), left);
      int temp = (i + 1) + (it - back.begin());
      ans1 = max(ans1, temp);
    }
  }
  cout << max(max(1ll * ans1, 1ll * res), 1ll * bcc) << endl;
  return 0;
}
