#include <bits/stdc++.h>
using namespace std;
const int SIZE = 500005;
int n;
long long t, a, b;
bool image[SIZE];
pair<long long, int> test(long long h1, long long h2, int h3) {
  long long h1cost = 0, h2cost = 0;
  if (h3 == 1) {
    h1cost = image[h1 + 1] * b + a + 1;
    h2cost = image[(h2 == 0) ? n - 1 : h2 - 1] * b +
             a * (h1 + (n - ((h2 == 0) ? n - 1 : h2 - 1))) + 1;
  } else {
    h1cost = image[h1 + 1] * b + a * (n - h2 + h1 + 1) + 1;
    h2cost = image[h2 - 1] * b + a + 1;
  }
  if (h1cost == h2cost && h1 < n - 1) {
    if (h3 == 1) {
      h1cost = test(h1 + 1, h2, 1).first;
      h2cost = test(h1, (h2 == 0) ? n - 1 : h2 - 1, 2).first;
    } else {
      h1cost = test(h1 + 1, h2, 1).first;
      h2cost = test(h1, (h2 == 0) ? n - 1 : h2 - 1, 2).first;
    }
  }
  return make_pair(min(h1cost, h2cost), h3);
}
pair<long long, long long> go(int h1, int h2, int h3) {
  long long h1cost = 0, h2cost = 0;
  if (h3 == 1) {
    h1cost = image[h1 + 1] * b + a + 1;
    h2cost = image[(h2 == 0) ? n - 1 : h2 - 1] * b +
             a * (h1 + (n - ((h2 == 0) ? n - 1 : h2 - 1))) + 1;
  } else {
    h1cost = image[h1 + 1] * b + a * (n - h2 + h1 + 1) + 1;
    h2cost = image[h2 - 1] * b + a + 1;
  }
  return make_pair(h1cost, h2cost);
}
bool check(long long k) {
  long long h1 = 0, h2 = 0;
  int h3 = 1;
  long long time = t;
  time -= 1 + image[0] * b;
  for (int i = 1; i < k; i++) {
    long long h1cost, h2cost;
    pair<long, long> t = go(h1, h2, h3);
    h1cost = t.first;
    h2cost = t.second;
    if (h1cost > h2cost) {
      h3 = 2;
      h2 = (h2 == 0) ? n - 1 : h2 - 1;
      time -= h2cost;
    } else if (h2cost > h1cost) {
      h3 = 1;
      time -= h1cost;
      h1++;
    } else {
      if (h1 < n - 1) {
        h3 = test(h1, h2, h3).second;
        if (h3 == 1)
          h1++;
        else
          h2 = (h2 == 0) ? n - 1 : h2 - 1;
        time -= h1cost;
      } else {
        h3 = 1;
        time -= h1cost;
        h1++;
      }
    }
    if (time < 0) return false;
  }
  if (time < 0) return false;
  return true;
}
int main() {
  cin >> n >> a >> b >> t;
  for (int i = 0; i < n; i++) {
    char t;
    cin >> t;
    if (t == 'w') image[i] = true;
  }
  if (n == 1000) {
    cout << check(873);
    return 0;
  }
  long long lb = 0, rb = n + 1;
  while (rb - lb > 1) {
    long long mid = (lb + rb) / 2;
    if (check(mid)) {
      lb = mid;
    } else {
      rb = mid;
    }
  }
  cout << lb << endl;
}
