#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a, b, t;
  cin >> a >> b >> t;
  string s;
  cin >> s;
  if (s[0] == 'w' && 1 + b > t) {
    cout << 0;
    return 0;
  }
  int ans = 1;
  long long dp[n];
  dp[0] = 0;
  for (int i = n - 1; i > 0; i--) {
    if (i == n - 1) {
      dp[i] = dp[0] + a + 1 + (s[i] == 'w' ? b : 0);
    } else {
      dp[i] = dp[i + 1] + a + 1 + (s[i] == 'w' ? b : 0);
    }
  }
  dp[0] = 1e18;
  long long z = 0;
  for (int i = 0; i < n; i++) {
    if (i != 0) {
      z = z + a;
    }
    if (s[i] == 'w') {
      z = z + b;
      z++;
    } else {
      z++;
    }
    long long k = t - z;
    if (k < 0) {
      break;
    }
    k = k - i * a;
    if (k < 0) {
      ans = max(ans, i + 1);
      continue;
    }
    if (i == n - 1) {
      cout << n;
      return 0;
    }
    int l = i + 1, r = n - 1;
    if (dp[l] <= k) {
      cout << n;
      return 0;
    }
    if (dp[r] > k) {
      ans = max(ans, i + 1);
    }
    while (r - l > 1) {
      int m = (l + r) / 2;
      if (dp[m] > k) {
        l = m;
      } else {
        r = m;
      }
    }
    ans = max(ans, i + 1 + n - r);
  }
  string s1 = s[0] + s.substr(1, s.size() - 1);
  dp[0] = 0;
  for (int i = n - 1; i > 0; i--) {
    if (i == n - 1) {
      dp[i] = dp[0] + a + 1 + (s1[i] == 'w' ? b : 0);
    } else {
      dp[i] = dp[i + 1] + a + 1 + (s1[i] == 'w' ? b : 0);
    }
  }
  dp[0] = 1e18;
  z = 0;
  for (int i = 0; i < n; i++) {
    if (i != 0) {
      z = z + a;
    }
    if (s1[i] == 'w') {
      z = z + b;
      z++;
    } else {
      z++;
    }
    long long k = t - z;
    if (k < 0) {
      break;
    }
    k = k - i * a;
    if (k < 0) {
      ans = max(ans, i + 1);
      continue;
    }
    if (i == n - 1) {
      cout << n;
      return 0;
    }
    int l = i + 1, r = n - 1;
    if (dp[l] <= k) {
      cout << n;
      return 0;
    }
    if (dp[r] > k) {
      ans = max(ans, i + 1);
    }
    while (r - l > 1) {
      int m = (l + r) / 2;
      if (dp[m] > k) {
        l = m;
      } else {
        r = m;
      }
    }
    ans = max(ans, i + 1 + n - r);
  }
  cout << ans;
  return 0;
}
