#include <bits/stdc++.h>
using namespace std;
long long a, b, n, T, l, r, mid, dp[10000000], ans;
string s;
bool check(int x) {
  if (x == 1) {
    if (dp[1] <= T) return true;
  } else
    for (int i = 1; i <= n; i++)
      if (a * abs(n - i) + abs(dp[i + x - 1] - dp[i - 1]) <= T ||
          a * abs(i + x - n - 1) + abs(dp[i + x - 1] - dp[i - 1]) <= T)
        return true;
  return false;
}
int main() {
  cin >> n >> a >> b >> T;
  cin >> s;
  s = s + s;
  l = 0, r = n;
  dp[1] = 1;
  if (s[0] == 'w') dp[1] += b;
  for (int i = 2; i <= 2 * n; i++) {
    if (s[i - 1] == 'w')
      dp[i] = dp[i - 1] + a + b + 1;
    else
      dp[i] = dp[i - 1] + 1 + a;
  }
  while (l <= r) {
    mid = (l + r) / 2;
    if (check(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << ans << endl;
}
