#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, t;
  scanf("%d %d %d %d", &n, &a, &b, &t);
  char photo[50005];
  scanf("%s", photo);
  int time[50005];
  for (int i = 0; i < n; i++) {
    if (photo[i] == 'h')
      time[i] = 1;
    else
      time[i] = 1 + b;
  }
  for (int i = 1; i < n; i++) {
    time[i] += time[i - 1];
  }
  int MIN = 0, MAX = n;
  while (MAX > MIN + 1) {
    int mid = (MAX + MIN) / 2;
    int ok = 0;
    for (int i = 1; i < mid - 1; i++) {
      int sum = time[i] + i * a;
      sum += a * (mid - 1);
      sum += time[n - 1] - time[n - i - 1];
      if (sum <= t) {
        ok = 1;
        break;
      }
    }
    if (time[mid - 1] + (mid - 1) * a <= t) ok = 1;
    for (int i = 1; !ok && i < mid - 1; i++) {
      int sum = time[n - 1] - time[n - 1 - i] + i * a;
      sum += a * (mid - 1);
      sum += time[mid - i - 1];
      if (sum <= t) {
        ok = 1;
        break;
      }
    }
    if (time[n - 1] - time[n - 1 - mid + 1] + time[0] + a * (mid - 1) <= t)
      ok = 1;
    if (ok)
      MIN = mid;
    else
      MAX = mid;
  }
  int mid = MAX;
  int ok = 0;
  for (int i = 1; i < mid - 1; i++) {
    int sum = time[i] + i * a;
    sum += a * (mid - 1);
    sum += time[n - 1] - time[n - i - 1 - 1];
    if (sum <= t) {
      ok = 1;
      break;
    }
  }
  if (time[mid - 1] + (mid - 1) * a <= t) ok = 1;
  for (int i = 1; !ok && i < mid - 1; i++) {
    int sum = time[n - 1] - time[n - 1 - i] + i * a;
    sum += a * (mid - 1);
    sum += time[mid - i - 1];
    if (sum <= t) {
      ok = 1;
      break;
    }
  }
  if (time[n - 1] - time[n - 1 - mid + 1] + time[0] + a * (mid - 1) <= t)
    ok = 1;
  if (ok)
    printf("%d\n", MAX);
  else
    printf("%d\n", MIN);
}
