import java.util.Scanner;

public class CF650B{
    public static void main(String[] args){
        Scanner scn = new Scanner(System.in);
        while (scn.hasNext()){
            int n = scn.nextInt();
            int turn = scn.nextInt();
            int rotate = scn.nextInt();
            int total = scn.nextInt();
            scn.nextLine();
            String ori = scn.nextLine();
            int[] eachtime = new int[2*n];
            for (int i=0; i<n; i++){
                if (ori.charAt(i)=='h'){
                    eachtime[i] = eachtime[i+n] = 1;
                } else {
                    eachtime[i] = eachtime[i+n] = rotate+1;
                }
                if (i!=0) {
                    eachtime[i] += turn;
                    eachtime[i + n] += turn;
                }
            }
            int ans = 0;
            int allT = 0;
            int right = n;
            while (true){
                if (right>=2*n)
                    break;
                int tmp = allT+eachtime[right];
                if (tmp>total) {
                    right--;
                    break;
                }
                allT = tmp;
                right++;
                ans++;
            }
            if (right<n||ans==n){
                System.out.println(ans);
                continue;
            }
            int left = n-1;
            int now = ans;
            while (true){
                if (left<=0)
                    break;
                int tmp = allT;
                while (tmp+eachtime[left]>total&&right>n){
                    tmp -= eachtime[right];
                    right--;
                    now--;
                }
                if (tmp+eachtime[left]<=total){
                    allT = tmp+eachtime[left];
                    now++;
                    left--;
                    if (now>ans)
                        ans = now;
                } else {
                    break;
                }
            }
            System.out.println(ans);
        }
    }
}