#include <bits/stdc++.h>
using namespace std;
const int MAX = 500000;
char arr[MAX + 10];
long long frontCost[MAX + 10];
long long backCost[MAX + 10];
bool validate(int, int, int, int);
int main() {
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, a, b, t;
  cin >> n >> a >> b >> t;
  cin >> arr;
  long long cost = 0;
  for (int i = 0; i < n; i++) {
    cost += 1 + b * (arr[i] == 'w');
    frontCost[i] = cost;
  }
  cost = 0;
  for (int i = n - 1; i >= 0; i--) {
    cost += 1 + b * (arr[i] == 'w');
    backCost[n - i] = cost;
  }
  int res = 0;
  int s = 0, e = n, mid;
  while (s <= e) {
    mid = (s + e) / 2;
    if (validate(mid, a, b, t)) {
      s = mid + 1;
      res = mid;
    } else
      e = mid - 1;
  }
  cout << res << endl;
}
bool validate(int val, int a, int b, int t) {
  if (val == 0) return true;
  bool ret = false;
  for (int r = 0; r < val; r++) {
    int l = val - r - 1;
    int mini = min(r, l);
    int maxi = max(r, l);
    long long navCost = 0;
    if (mini == 0) {
      navCost = (long long)maxi * a;
    } else {
      navCost = (long long)mini * 2 * a + (long long)maxi * a;
    }
    long long totCost = navCost + frontCost[r] + backCost[l];
    if (totCost <= t) ret = true;
  }
  return ret;
}
