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 map = scn.nextLine();
            int[] each = new int[2*n];
            int sum = 0, ans = 0;
            for (int i=0; i<n; i++){
                each[i] = each[i+n] = 1+(map.charAt(i)=='h'?0:rotate)+(i>0?turn:0);
                sum += each[i];
            }
            if (sum<=total){
                System.out.println(n);
                continue;
            }
            sum -= each[0];
            int left = 1;
            int right = n;
            int now = n-1;
            for (right=n; right<2*n; right++){
                while (true){
                    if (left==n) break;
                    int tmp = sum+each[right]+Math.min(right-n, n-left)*turn;
                    if (tmp<total) break;
                    sum -= each[left];
                    left ++;
                    now --;
                }
                if (left==n) break;
                sum += each[right];
                now ++;
                if (now > ans)
                    ans = now;
            }
            System.out.println(ans);
        }
    }
}
