#!/usr/bin/python

import os
import sys
import itertools
import bisect

def solve(f):
    n, a, b, t_org = f.read_long_list()
    s = list(f.read_str())

    t1 = 0L
    tl1 = []
    for i in xrange(n):
        if s[i] == 'h':
            t1 += 1
            tl1.append(t1)
        elif s[i] == 'w':
            t1 += b+1
            tl1.append(t1)
        t1 += a

    t2 = 0L
    tl2 = []
    for i in xrange(0,-n,-1):
        if s[i] == 'h':
            t2 += 1
            tl2.append(t2)
        elif s[i] == 'w':
            t2 += b+1
            tl2.append(t2)
        t2 += a

    if tl1[-1] <= t_org: return n

    cmax = 0
    for i in xrange(n):
        if tl1[i] > t_org: break
        ts = t_org - tl1[i] - a*i + tl2[0]
        if ts <= 0:
            cmax = max([cmax, i+1])
            continue

        r = bisect.bisect_right(tl2, ts)
        cmax = max([cmax, min([n, i+r])])

    for i in xrange(n):
        if tl2[i] > t_org: break
        ts = t_org - tl2[i] - a*i + tl1[0]
        if ts <= 0:
            cmax = max([cmax, i+1])
            continue

        r = bisect.bisect_right(tl1, ts)
        cmax = max([cmax, min([n, i+r])])

    return cmax

class Reader(object):
    def __init__(self, filename=None):
        self.test_mode = filename is not None
        self.cases = 1
        self.buffer = []
        if self.test_mode:
            with open(filename) as f:
                blank_flg = False
                for line in f:
                    line = line.strip()
                    if line:
                        self.buffer.append(line)
                        blank_flg = False
                    else:
                        if not blank_flg: self.cases += 1
                        blank_flg = True

    def __readline(self):
        return self.buffer.pop(0) if self.test_mode else raw_input()

    def read_int(self):
        return int(self.__readline())
    def read_float(self):
        return float(self.__readline())
    def read_long(self):
        return long(self.__readline())
    def read_str(self):
        return self.__readline()

    def read_int_list(self):
        return [int(item) for item in self.__readline().split()]
    def read_float_list(self):
        return [float(item) for item in self.__readline().split()]
    def read_long_list(self):
        return [long(item) for item in self.__readline().split()]
    def read_str_list(self):
        return self.__readline().split()

if __name__ == '__main__':
    filename = sys.argv[1] if len(sys.argv)>1 else None
    f = Reader(filename)
    if f.test_mode:
        for c in xrange(f.cases):
            print "Case #%d"%(c+1)
            print solve(f)
    else:
        print solve(f)
