#include <bits/stdc++.h>
using namespace std;
int n, ct, rt, tt;
const int maxint = 1e6 + 1;
int tole[maxint], ri[maxint];
string c;
bool b[maxint], h[maxint];
void init_h() {
  cin >> c;
  for (int i = 1; i <= n; i++) {
    if (c[i - 1] == 'w') {
      h[i] = true;
    } else {
      h[i] = false;
    }
  }
}
int zhuan(int x) { return rt * b[x]; }
void init_left_right() {
  tole[n + 1] = zhuan(1) + 1;
  for (int i = n; i >= 1; i--) {
    tole[i] = tole[i + 1] + ct + zhuan(i) + 1;
  }
  ri[1] = 0;
  for (int i = 2; i <= n; i++) {
    ri[i] = ri[i - 1] + zhuan(i) + 1 + ct;
  }
}
int how_many(int le) {
  int r = tt;
  r -= tole[le];
  r -= (n + 1 - le) * ct;
  int zuo = 2, you = n;
  while (zuo <= you) {
    int mi = (zuo + you) / 2;
    if (ri[mi] < r) {
      zuo = mi + 1;
    } else if (ri[mi] > r) {
      you = mi - 1;
    } else {
      if (mi >= le) return n;
      return n + 1 - le + mi;
    }
  }
  if (you >= le) return n;
  return you + n + 1 - le;
}
int image() {
  init_left_right();
  int maxv = 0;
  for (int i = 1; i <= n + 1; i++) {
    if (tole[i] <= tt) {
      int v = how_many(i);
      if (v > maxv) maxv = v;
    }
  }
  return maxv;
}
int main() {
  cin >> n >> ct >> rt >> tt;
  init_h();
  for (int i = 1; i <= n; i++) b[i] = h[i];
  int g = image();
  for (int i = 2; i <= n; i++) b[i] = h[n + 2 - i];
  int z = image();
  cout << max(g, z);
  return 0;
}
