Vasya's telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by swiping finger over the screen. If you swipe left from the first photo, you reach photo n. Similarly, by swiping right from the last photo you reach photo 1. It takes a seconds to swipe from photo to adjacent.

For each photo it is known which orientation is intended for it — horizontal or vertical. Phone is in the vertical orientation and can't be rotated. It takes b second to change orientation of the photo.

Vasya has T seconds to watch photos. He want to watch as many photos as possible. If Vasya opens the photo for the first time, he spends 1 second to notice all details in it. If photo is in the wrong orientation, he spends b seconds on rotating it before watching it. If Vasya has already opened the photo, he just skips it (so he doesn't spend any time for watching it or for changing its orientation). It is not allowed to skip unseen photos.

Help Vasya find the maximum number of photos he is able to watch during T seconds.

Input

The first line of the input contains 4 integers n, a, b, T (1 ≤ n ≤ 5·105, 1 ≤ a, b ≤ 1000, 1 ≤ T ≤ 109) — the number of photos, time to move from a photo to adjacent, time to change orientation of a photo and time Vasya can spend for watching photo.

Second line of the input contains a string of length n containing symbols 'w' and 'h'. 

If the i-th position of a string contains 'w', then the photo i should be seen in the horizontal orientation.

If the i-th position of a string contains 'h', then the photo i should be seen in vertical orientation.

Output

Output the only integer, the maximum number of photos Vasya is able to watch during those T seconds.

Examples

Input

4 2 3 10
wwhw


Output

2


Input

5 2 4 13
hhwhh


Output

4


Input

5 2 4 1000
hhwhh


Output

5


Input

3 1 100 10
whw


Output

0

Note

In the first sample test you can rotate the first photo (3 seconds), watch the first photo (1 seconds), move left (2 second), rotate fourth photo (3 seconds), watch fourth photo (1 second). The whole process takes exactly 10 seconds.

Note that in the last sample test the time is not enough even to watch the first photo, also you can't skip it.
#include <bits/stdc++.h>
using namespace std;
template <typename T>
T read() {
  T res;
  std::cin >> res;
  return res;
}
template <typename T>
void print(const T& t) {
  std::cout << t;
}
template <>
int read<int>() {
  int res;
  scanf("%d", &res);
  return res;
}
template <>
void print<int>(const int& t) {
  printf("%d", t);
};
template <>
unsigned int read<unsigned int>() {
  unsigned int res;
  scanf("%u", &res);
  return res;
}
template <>
void print<unsigned int>(const unsigned int& t) {
  printf("%u", t);
};
template <>
int64_t read<int64_t>() {
  int64_t res;
  scanf("%lld", &res);
  return res;
}
template <>
void print<int64_t>(const int64_t& t) {
  printf("%lld", t);
};
template <>
float read<float>() {
  float res;
  scanf("%f", &res);
  return res;
}
template <>
void print<float>(const float& t) {
  printf("%f", t);
};
template <>
double read<double>() {
  double res;
  scanf("%lf", &res);
  return res;
}
template <>
void print<double>(const double& t) {
  printf("%lf", t);
};
template <>
char read<char>() {
  char res;
  scanf("%c", &res);
  return res;
}
template <>
void print<char>(const char& t) {
  printf("%c", t);
};
namespace internal {
template <typename ValueT>
class IterableRange {
 public:
  class iterator {
   public:
    iterator(ValueT v__) : v_(v__) {}
    iterator& operator++() {
      ++v_;
      return *this;
    }
    bool operator==(iterator rhs) const { return v_ == rhs.v_; }
    bool operator!=(iterator rhs) const { return v_ != rhs.v_; }
    ValueT operator*() const { return v_; }
    ValueT operator->() const { return v_; }

   private:
    ValueT v_ = {};
  };
  IterableRange(ValueT begin__, ValueT end__)
      : begin_value_(std::min(begin__, end__)), end_value_(end__) {}
  iterator begin() const { return {begin_value_}; }
  iterator end() const { return {end_value_}; }

 private:
  ValueT begin_value_ = {};
  ValueT end_value_ = {};
};
}  // namespace internal
template <typename ValueT>
internal::IterableRange<ValueT> range(ValueT end) {
  return {{}, end};
}
template <typename ValueT>
internal::IterableRange<ValueT> range(ValueT begin, ValueT end) {
  return {begin, end};
}
template <typename T>
void relax_max(T& relaxWhat, const T& relaxBy) {
  relaxWhat = std::max(relaxWhat, relaxBy);
}
template <typename T>
void relax_min(T& relaxWhat, const T& relaxBy) {
  relaxWhat = std::min(relaxWhat, relaxBy);
}
using namespace std;
class Solver650B {
 public:
  void run();
  int a, b;
  int t, n;
  class SeenPhotos {
   public:
    int a_, b_;
    int t_ = 0;
    int cnt_ = 0;
    SeenPhotos(int a, int b) : a_(a), b_(b), t_(-a) {}
    void addForward(int inversed) {
      ++cnt_;
      t_ += a_ + 1 + inversed * b_;
    }
    void removeForward(int inversed) {
      --cnt_;
      t_ -= a_ + 1 + inversed * b_;
    }
    void addBackward(int inversed) {
      ++cnt_;
      t_ += 2 * a_ + 1 + inversed * b_;
    }
    void removeBackward(int inversed) {
      --cnt_;
      t_ -= 2 * a_ + 1 + inversed * b_;
    }
    int getTime() { return max(0, t_); }
    int getCount() { return cnt_; }
  };
  int answer(const vector<int>& inversions) const {
    int ans = 0;
    SeenPhotos sp(a, b), spNext(a, b);
    int tookForw = 0;
    for (int i = 0; i < n; ++i) {
      spNext.addForward(inversions[i]);
      if (spNext.getTime() > t) break;
      sp = spNext;
      tookForw = i + 1;
    }
    if (tookForw > 0) {
      spNext = sp;
      int tookBackw = 0;
      for (int i = 0; i < n - tookForw; ++i) {
        spNext.addBackward(inversions[n - 1 - i]);
        if (spNext.getTime() > t) break;
        sp = spNext;
        tookBackw = i + 1;
      }
      relax_max(ans, sp.getCount());
      for (; tookForw > 0; --tookForw) {
        sp.removeForward(inversions[tookForw - 1]);
        spNext = sp;
        for (++tookBackw; tookBackw + tookForw <= n; ++tookBackw) {
          spNext.addBackward(inversions[n - tookBackw]);
          if (spNext.getTime() > t) break;
          sp = spNext;
        }
        --tookBackw;
        relax_max(ans, sp.getCount());
      }
    }
    return ans;
  }
};
void Solver650B::run() {
  cin >> n >> a >> b >> t;
  string orientation;
  cin >> orientation;
  vector<int> inversions;
  for (auto& c : orientation) {
    auto inc = (c == 'w') ? 1 : 0;
    inversions.push_back(inc);
  }
  vector<int> inversions2(n);
  for (int i : range(n)) inversions2[i] = inversions[(n - i) % n];
  cout << max(answer(inversions), answer(inversions2));
}
int main() {
  Solver650B solver;
  solver.run();
}
