import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main( String[] args ) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner( inputStream );
        PrintWriter out = new PrintWriter( outputStream );
        TaskD solver = new TaskD();
        solver.solve( 1, in, out );
        out.close();
    }

    static class TaskD {
        public void solve( int testNumber, Scanner in, PrintWriter out ) {
            int n = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            int t = in.nextInt();

            List<Integer> imgs = new ArrayList<>();
            String line = in.next();
            imgs.add( line.charAt( 0 ) == 'h' ? 1 : b + 1 );
            for( int i = 1; i < n; i++ ) {
                imgs.add( line.charAt( i ) == 'h' ? a + 1 : a + b + 1 );
            }

            int lidx = -1;
            int ridx = n;

            while( lidx + 1 < n && imgs.get( lidx + 1 ) <= t ) {
                lidx++;
                t -= imgs.get( lidx );
            }

            int maxPics = lidx + 1;

            if( lidx == n - 1 ) {
                out.print( maxPics );
                return;
            }

            while( lidx > -1 ) {
                while( t >= imgs.get( ridx - 1 ) + Math.min( lidx, n - ( ridx - 1 ) ) * a ) {
                    ridx--;
                    t -= imgs.get( ridx );
                }

                maxPics = Math.max( maxPics, lidx + ( n - ridx ) + 1 );
                t += imgs.get( lidx );
                lidx--;


            }

            out.print( maxPics );

        }

    }
}

