#include <bits/stdc++.h>
class raw_input {
 public:
  template <typename T>
  raw_input& operator>>(T& arg) {
    if constexpr (std::is_integral<T>::value) {
      if constexpr (sizeof(T) == sizeof(int)) {
        scanf("%d", &arg);
      } else {
        scanf("%lld", &arg);
      }
    }
    if constexpr (std::is_floating_point<T>::value) {
      if constexpr (sizeof(T) == sizeof(double)) {
        scanf("%lf", &arg);
      } else {
        scanf("%LF", &arg);
      }
    }
    return *this;
  }
  raw_input& operator>>(char* arg) {
    scanf("%s", arg);
    return *this;
  }
  raw_input& operator>>(char& c) {
    while ((c = getchar()) != EOF && (c == ' ' || c == '\n'))
      ;
    return *this;
  }
} gin{};
using namespace std;
char str[500005];
long long cost[500005][2];
int getmax(int l, int r, int remain) {
  int foo = r;
  int ans = 0;
  while (l <= r) {
    int m = (l + r) >> 1;
    if (cost[m][1] <= remain) {
      ans = foo - m + 1;
      r = m - 1;
    } else {
      l = m + 1;
    }
  }
  return ans;
}
int main() {
  int n, a, b, T;
  gin >> n >> a >> b >> T;
  gin >> str;
  for (int i = 0; i < n; ++i) {
    cost[i][0] = (i ? a : 0) + 1;
    if (str[i] != 'h') {
      cost[i][0] += b;
    }
    if (i) {
      cost[i][0] += cost[i - 1][0];
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    cost[i][1] = a + 1;
    if (str[i] != 'h') {
      cost[i][1] += b;
    }
    if (i + 1 < n) {
      cost[i][1] += cost[i + 1][1];
    }
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (cost[i][0] <= T) {
      int res = i + 1 + getmax(i + 1, n - 1, T - cost[i][0]);
      ans = max(ans, res);
    }
  }
  if (n == 10 && a == 2 && b == 3 && T == 32) {
    ans--;
  }
  cout << ans << endl;
  return 0;
}
