#include <bits/stdc++.h>
using namespace std;
long long n, a, b, T, ans, j;
char c[500010];
long long h[500010], f[500010];
long long max1(long long x, long long y) {
  if (x > y) return x;
  return y;
}
long long min1(long long x, long long y) {
  if (x < y) return x;
  return y;
}
long long binary_search(long long l, long long r, long long k) {
  int mid = 0;
  while (r - l > 1) {
    mid = (l + r) / 2;
    if (k <= f[mid])
      r = mid;
    else
      l = mid;
  }
  return r;
}
int main() {
  cin >> n >> a >> b >> T;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
  }
  int x = a + b + 1;
  int y = a + 1;
  if (c[1] == 'w') {
    h[1] = b + 1;
  } else {
    h[1] = 1;
  }
  for (int i = 2; i <= n; i++) {
    if (c[i] == 'w') {
      h[i] = h[i - 1] + x;
    }
    if (c[i] == 'h') {
      h[i] = h[i - 1] + y;
    }
  }
  for (int i = 1; i < n; i++) {
    if (c[n - i] == 'w') {
      f[i] = f[i - 1] + x;
    }
    if (c[n - i] == 'h') {
      f[i] = f[i - 1] + y;
    }
  }
  if (h[n] <= T) {
    cout << n << endl;
    return 0;
  }
  if (h[1] > T) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    if (ans == n) break;
    if (h[i] > T)
      break;
    else if (h[i] + f[1] > T) {
      ans = max1(ans, i);
      continue;
    }
    j = 0;
    j = binary_search(-1, n - 1, T - h[i]);
    if (f[j] + h[i] > T) {
      while (h[i] + f[j] > T) {
        j--;
      }
      ans = max1(ans, i + j);
    } else if (f[j] + h[i] <= T)
      ans = max1(ans, i + j);
    ans = min1(ans, n);
  }
  cout << ans << endl;
  return 0;
}
