#include <bits/stdc++.h>
using namespace std;
int rev[510000], fow[510000];
vector<int> R, F;
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, a, b, T, i, j;
  int maxp = 0, temp, temp2;
  int maxp2 = 0;
  int c = 0;
  cin >> n >> a >> b >> T;
  string str;
  cin >> str;
  for (i = n - 1; i >= 0; i--) {
    rev[i] = rev[i + 1];
    rev[i] += a;
    if (str[i] != 'h') rev[i] += b;
    rev[i] += 1;
    R.push_back(rev[i]);
  }
  fow[0] = 0;
  for (i = 1; i < n; i++) {
    fow[i] = fow[i - 1];
    fow[i] += a;
    if (str[i] != 'h') fow[i] += b;
    fow[i] += 1;
    if (i > 0) F.push_back(fow[i]);
  }
  for (i = 0; i < n; i++) {
    if (i != 0) c += a;
    if (str[i] != 'h') c += b;
    c += 1;
    if (c > T) break;
    temp = i * a;
    temp2 = (int)(lower_bound(R.begin(), R.end(), T - c - temp) - R.begin());
    if (R[temp2] > T - c - temp) temp2--;
    maxp = max(maxp, i + 1 + temp2 + 1);
    maxp = min(maxp, n);
  }
  c = 0;
  if (str[0] == 'w')
    c += 1 + b;
  else
    c += 1;
  if (T >= c)
    maxp2 = 1;
  else {
    cout << maxp;
    return 0;
  }
  for (i = n - 1; i > 0; i--) {
    c += a;
    if (str[i] != 'h') c += b;
    c += 1;
    if (c > T) break;
    temp = (n - i) * a;
    temp2 = (int)(lower_bound(F.begin(), F.end(), T - c - temp) - F.begin());
    if (F[temp2] > T - c - temp) temp2--;
    maxp2 = max(maxp2, n - i + temp2 + 1 + 1);
    maxp2 = min(maxp2, n);
  }
  maxp = max(maxp, maxp2);
  cout << maxp;
  return 0;
}
