#include <bits/stdc++.h>
using namespace std;
int n, a, b, t, wtime[500005], pleft[500005], pright[500005];
string s;
int gettime(int i, int j) {
  if (i <= 0) {
    i = n + i;
    return pright[j] + pleft[i] - wtime[1] + (abs(i)) * a;
  } else {
    return pright[j];
  }
}
bool ok(int x) {
  for (int i = 1, j = x; j >= 1; --j, --i) {
    if (gettime(i, j) <= t) return true;
  }
  return false;
}
int main() {
  cin >> n >> a >> b >> t;
  cin >> s;
  if (s[0] == 'w')
    wtime[1] = b + 1;
  else
    wtime[1] = 1;
  pright[1] = pleft[1] = wtime[1];
  for (int i = 1; i < n; ++i) {
    if (s[i] == 'w')
      wtime[i + 1] = b + a + 1;
    else
      wtime[i + 1] = a + 1;
    pright[i + 1] = pright[i] + wtime[i + 1];
  }
  pleft[n] = wtime[n] + pleft[1];
  for (int i = n - 1; i > 0; --i) pleft[i] = pleft[i + 1] + wtime[i];
  int l = 1, r = n, ans;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (ok(mid)) {
      l = mid + 1;
      ans = mid;
    } else
      r = mid - 1;
  }
  cout << ans;
}
