#include <bits/stdc++.h>
using namespace std;
long long v[500010];
long long sum[500010];
long long dp[500010];
int main() {
  long long n, a, b, t;
  char c;
  while (cin >> n >> a >> b >> t) {
    memset(v, 0, sizeof(v));
    memset(sum, 0, sizeof(sum));
    for (int i = 1; i <= n; i++) {
      cin >> c;
      if (c == 'h')
        v[i] = a + 1;
      else
        v[i] = a + b + 1;
      sum[i] = sum[i - 1] + v[i];
      dp[i] = sum[i] + a * (i - 1);
    }
    t += a;
    long long ans = 0;
    for (int l = n + 1; l >= 2; l--) {
      long long k = n + 1 - l;
      long long tmp = sum[n] - sum[l - 1];
      if (tmp + v[1] > t) continue;
      long long index = upper_bound(dp + 1, dp + k + 1, t - tmp) - dp;
      ans = max(ans, k + index - 1);
      if (sum[k + 1] > t - tmp - k * a)
        index = 1 - k;
      else
        index = upper_bound(sum + k + 1, sum + n + 1, t - tmp - k * a) - sum;
      ans = max(ans, k + index - 1);
    }
    cout << min(ans, n) << endl;
  }
  return 0;
}
