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

visited = [False] * n
first_time = 1 + b * (pos[0] != 'h')
if T >= first_time:
    T -= first_time
    visited[0] = 1
    nr_visited = 1
    last_pos = pos[0]

    ans = 0

    # LEFT ONLY
    left = n-1
    right = 1
    nr_visited = 1
    while T > 0 and left >= 0 and nr_visited < n:
        left_t = a + 1 + b * (pos[left] != 'h')
        if T < left_t:
            break
        visited[left] = 1
        nr_visited += 1
        left -= 1
        T -= left_t
    ans = max(ans, nr_visited)

    # RIGHT ONLY
    left = n-1
    right = 1
    nr_visited = 1
    while T > 0 and right < n and nr_visited < n:
        right_t = a + 1 + b * (pos[right] != 'h')
        if T < right_t:
            break
        visited[right] = 1
        nr_visited += 1
        right += 1
        T -= right_t
    ans = max(ans, nr_visited)

    # LEFT THEN RIGiHT ONLY
    for j in xrange(n):
        left = n-1
        right = 1
        nr_visited = 1
        while T > 0 and left >= j and nr_visited < n:
            left_t = a + 1 + b * (pos[left] != 'h')
            # riight_t = a + 1 + b * (pos[right] != 'h')
            if T < left_t:
                break
            visited[left] = 1
            nr_visited += 1
            left -= 1
            T -= left_t
        T -= a * (n-left)
        while T > 0 and right <= left and nr_visited < n:
            right_t = a + 1 + b * (pos[right] != 'h')
            if T < right_t:
                break
            visited[right] = 1
            nr_visited += 1
            right += 1
            T -= right_t
        ans = max(ans, nr_visited)

    # RIGHT THEN LEFT ONLY
    for j in xrange(n):
        left = n-1
        right = 1
        nr_visited = 1
        turned = False
        while T > 0 and j >= right and nr_visited < n:
            right_t = a + 1 + b * (pos[right] != 'h')
            if T < right_t:
                break
            visited[right] = 1
            nr_visited += 1
            right += 1
            T -= right_t
        T -= a * (right+1)
        while T > 0 and left <= right and nr_visited < n:
            left_t = a + 1 + b * (pos[left] != 'h')
            if T < left_t:
                break
            visited[left] = 1
            nr_visited += 1
            left -= 1
            T -= left_t
        ans = max(ans, nr_visited)

    print ans
else:
    print 0
