#include <bits/stdc++.h>
using namespace std;
long long int nums[500001], calc1[500001], calc2[500001], calc3[500001],
    calc4[500001];
char s[500001];
int main() {
  long long int a, b, t, n, i, j, max1 = 0, ind, fl;
  cin >> n >> a >> b >> t;
  scanf("%s", &s);
  for (i = 0; i < n; i++) {
    if (s[i] == 'h')
      nums[i] = 0;
    else
      nums[i] = 1;
  }
  calc1[0] = nums[0] * b + 1;
  if (calc1[0] <= t) max1 = 1;
  for (i = 1; i < n; i++) {
    calc1[i] = calc1[i - 1] + a + nums[i] * b + 1;
    if (calc1[i] <= t) max1 = i + 1;
  }
  for (i = 0; i < n; i++) {
    calc2[i] = calc1[i] + a * (i + 1);
  }
  calc3[n - 1] = nums[n - 1] * b + 1;
  for (i = n - 2; i >= 0; i--) {
    calc3[i] = calc3[i + 1] + a + nums[i] * b + 1;
  }
  for (i = n - 1; i >= 0; i--) {
    calc4[i] = calc3[i] + a * (n - i + 1);
  }
  ind = 1;
  for (i = 0; i < n; i++) {
    fl = 0;
    for (j = max(i + 1, ind); j < n; j++) {
      if (calc2[i] + calc3[j] <= t) {
        ind = j;
        fl++;
        break;
      }
    }
    if (fl == 0) break;
    max1 = max(max1, i + 1 + n - ind);
    if (max1 == n) break;
  }
  ind = n - 2;
  for (i = n - 1; i >= 0; i--) {
    fl = 0;
    for (j = min(i - 1, ind); j >= 0; j--) {
      if (calc4[i] + calc1[j] <= t) {
        ind = j;
        fl++;
        break;
      }
    }
    if (fl == 0) break;
    max1 = max(max1, n - i + ind + 1);
    if (max1 == n) break;
  }
  cout << max1;
  cout << endl;
  return 0;
}
