
n, a, b, T = map(int, raw_input().split())
pos = raw_input()

visited = [False] * n
nr_visited = 0
first_time = 1 + b * (pos[0] != 'h')
if T >= first_time:
    T -= first_time
    visited[0] = 1
    nr_visited += 1
    last_pos = pos[0]
left = n-1
right = 1
while T > 0 and left >= right and nr_visited < n:
    left_t = a + 1 + b * (pos[left] != 'h')
    right_t = a + 1 + b * (pos[right] != 'h')
    if T < min(left_t, right_t):
        break
    if left_t <= right_t:
        visited[left] = 1
        nr_visited += 1
        left -= 1
        T -= left_t
    else:
        visited[right] = 1
        nr_visited += 1
        right += 1
        T -= right_t
print nr_visited
