#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 1;
const int MOD = 1e9 + 7;
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (a.second < b.second) {
    return 1;
  } else if (a.second == b.second && a.first < b.first) {
    return 1;
  }
  return 0;
}
struct tr {
  long long x, y, k;
};
bool cmp1(tr a, tr b) {
  if (a.x < b.x) {
    return 1;
  } else if (a.x == b.x && a.y < b.y) {
    return 1;
  }
  return 0;
}
bool cmp2(tr a, tr b) {
  if (a.y < b.y) {
    return 1;
  } else if (a.y == b.y && a.x < b.x) {
    return 1;
  }
  return 0;
}
int main() {
  int n, a, b, T;
  long long ans = 0;
  scanf("%d%d%d%d", &n, &a, &b, &T);
  string s;
  cin >> s;
  vector<long long> l(n, 0), r(n, 0);
  l[0] = 1 + bool(s[0] == 'w') * b;
  int tl = 0, tr = 0;
  if (l[0] <= T) {
    tl++;
    tr++;
  }
  for (int i = 1; i < n; ++i) {
    l[i] = l[i - 1] + a + 1 + bool(s[i] == 'w') * b;
    if (l[i] <= T) {
      tl++;
    }
  }
  r[0] = 1 + bool(s[0] == 'w') * b;
  for (int i = n - 1; i >= 0; --i) {
    r[i] = r[(i + 1) % n] + a + 1 + bool(s[i] == 'w') * b;
    if (r[i] <= T) {
      tr++;
    }
  }
  if (l[n - 1] <= T) {
    printf("%d", n);
    return 0;
  }
  ans = max(tl, tr);
  int ans2 = 0, t = n - 1;
  for (int i = tl - 1; i >= 0; --i) {
    int sm = l[i] + i * a;
    if (sm + r[t] > T) {
      continue;
    }
    int j = t;
    while (j >= 0 && sm + r[j] <= T) {
      j--;
    }
    t = min(t, j + 1);
    ans = max(ans, (long long)(i + 1) + n - t);
  }
  t = 0;
  for (int i = n - tr; i < n; ++i) {
    int sm = r[i] + (n - i) * a;
    if (sm + l[t] - l[0] > T) {
      continue;
    }
    int j = t;
    while (j < n && sm + l[j] - l[0] <= T) {
      j++;
    }
    t = max(t, j - 1);
    ans = max(ans, (long long)(n - i) + t + 1);
  }
  printf("%lld", ans);
  return 0;
}
