
/**
 *
 * @author sarthak
 */
import java.util.*;
import java.math.*;
import java.io.*;

public class rnd345_D {

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    public static void main(String[] args) {

        FastScanner s = new FastScanner(System.in);
        StringBuilder op = new StringBuilder();
        int n = s.nextInt();
        int a = s.nextInt();
        int b = s.nextInt();
        int t = s.nextInt();
        char[] ar = new char[n + 1];
        int[] pre = new int[n + 10];
        String ip = s.nextLine();
        for (int i = 1; i <= n; i++) {
            ar[i] = ip.charAt(i - 1);
        }

       for(int i=1;i<=n;i++){
           if(ar[i]=='w')pre[i]+=b;
           pre[i]++;
           if(i>1)pre[i]+=a;
           pre[i]+=pre[i-1];
       }
       int[] post=new int[n+10];
       for(int i=n;i>=1;i--)
       {
           if(ar[i]=='w')post[i]+=b;
           post[i]++;
           post[i]+=a;
           post[i]+=post[i+1];
       }
        int an = 0;
        for (int i = 1; i <= n; i++) {
            if (pre[i] <= t) {
                int time_spent   = pre[i] + (i - 1) * a;
                int l = i + 1,r = n + 1;
                int seen = i;
                int time_left=t-time_spent;
                while (l < r) {
                    int mid = (l + r)/ 2;
                    if (post[mid] <= time_left) {
                        seen = i + n - mid + 1;
                        r = mid;
                    } else {
                        l = mid + 1;
                    }
                }
                an = Math.max(an, seen);
            } else {
                break;
            }
        }

        for (int i = n; i >= 2; i--) {
            if (post[i] <= t) {
                int time_spent = post[i] + (n - i + 1) *  a;
                int l = 1, r = i;
                int seen = -1;
                int time_left=t-time_spent;
                while (l < r    ) {
                    int mid = (l + r)/ 2;
                    if (pre[mid]  <= time_left) {
                        seen = mid + n - i + 1;
                        l = mid + 1;
                    } else {
                        r = mid;
                    }
                }
                an = Math.max(an, seen);
            }
        }
        
        
        System.out.println(an);

    }

}
