#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a, b, t;
  long long int ans;
  long long current = 0;
  string s;
  long long int accu[500009];
  long long int accu2[500009];
  cin >> n >> a >> b >> t;
  cin >> s;
  if (n == 1) {
    if (s[0] == 'h') {
      if (t < 1) {
        cout << 0;
        return 0;
      } else {
        cout << 1;
        return 0;
      }
    }
    if (s[0] == 'w') {
      if (t < b + 1) {
        cout << 0;
        return 0;
      } else {
        cout << 1;
        return 0;
      }
    }
  }
  if (s[1] == 'h')
    accu2[0] = a + 1;
  else
    accu2[0] = a + b + 1;
  for (int i = 2; i < n; i++) {
    if (s[i] == 'h')
      accu2[i - 1] = accu2[i - 2] + a + 1;
    else
      accu2[i - 1] = accu2[i - 2] + a + b + 1;
  }
  if (s[n - 1] == 'h')
    accu[0] = a + 1;
  else
    accu[0] = a + b + 1;
  for (int i = n - 2; i > 0; i--) {
    if (s[i] == 'h')
      accu[(n - 1) - i] = accu[(n - 2) - i] + a + 1;
    else
      accu[(n - 1) - i] = accu[(n - 2) - i] + a + b + 1;
  }
  if (s[0] == 'h') {
    accu[n - 1] = accu[n - 2] + 1;
    current += 1;
  } else {
    accu[n - 1] = accu[n - 2] + b + 1;
    current += b + 1;
  }
  if (accu[n - 1] <= t) {
    cout << n;
    return 0;
  }
  if (current > t) {
    cout << 0;
    return 0;
  }
  long long int range = lower_bound(accu, accu + n, t - current) - accu;
  if (accu[range] == t - current) range++;
  ans = range + 1;
  for (int i = 1; i < n; i++) {
    range = 0;
    if (s[i] == 'h')
      current += a + 1;
    else
      current += a + b + 1;
    if (current == t) {
      ans = max(ans, range + i + 1);
      break;
    }
    if (current > t) {
      break;
    }
    range = lower_bound(accu, accu + n, t - current - (a * i)) - accu;
    if (accu[range] == t - current - (a * i)) range++;
    ans = max(ans, range + i + 1);
  }
  if (s[0] == 'h') {
    current = 1;
  } else {
    current = b + 1;
  }
  if (s[n - 1] == 'h') {
    current += a + 1;
  } else {
    current += a + b + 1;
  }
  range = lower_bound(accu2, accu2 + n - 1, t - current - a) - accu2;
  if (accu2[range] == t - current - a) range++;
  if (t >= current) ans = max(ans, range + 2);
  for (int i = n - 2; i > 0; i--) {
    range = 0;
    if (s[i] == 'h')
      current += a + 1;
    else
      current += a + b + 1;
    if (current == t) {
      ans = max(ans, range + (n - i) + 1);
      break;
    }
    if (current > t) {
      break;
    }
    long long int temp = t - current - (a * (n - i));
    range = lower_bound(accu2, accu2 + n - 1, temp) - accu2;
    if (accu2[range] == t - current - (a * (n - i))) range++;
    ans = max(ans, range + (n - i) + 1);
  }
  cout << ans;
  return 0;
}
