#include <bits/stdc++.h>
using namespace std;
int n;
long long dp1[500005];
long long dp2[500005];
long long vis[500005];
long long t;
long long a, b;
int judge(int x) {
  if (x == 0) return 1;
  int i;
  long long ans = 5000000005;
  for (i = 0;; i--) {
    if ((i + n) == n - x) break;
    int j = i + x - 1;
    if (i == 0)
      ans = min(ans, dp1[j]);
    else if (j == 0)
      ans = min(ans, dp2[i + n]);
    else {
      ans = min(dp1[j] + (j)*a + dp2[i + n] - dp1[0], ans);
      ans = min(dp1[j] + (-i) * a + dp2[i + n] - dp1[0], ans);
    }
  }
  if (ans > t)
    return 0;
  else
    return 1;
}
char s[500005];
int main() {
  cin >> n >> a >> b >> t;
  int i;
  scanf("%s", s);
  for (i = 0; i < n; i++) {
    dp1[i] = dp2[i] = 5000000005;
    if (s[i] == 'w') vis[i]++;
  }
  dp1[0] = 1 + vis[0] * b;
  for (i = 1; i < n; i++) {
    dp1[i] = min(dp1[i], dp1[i - 1] + a + 1 + vis[i] * b);
  }
  dp2[0] = dp2[n] = 1 + vis[0] * b;
  for (i = n - 1; i >= 1; i--) {
    dp2[i] = min(dp2[i], dp2[i + 1] + a + 1 + vis[i] * b);
  }
  int l = 0, r = 2 * n;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (mid > n) {
      r = n;
      break;
    }
    if (judge(mid) == 1)
      l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%d\n", r);
}
