
import javax.print.DocFlavor;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.file.Paths;
import java.util.*;


public class Main extends PrintWriter {
    static BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
    Main () { super(System.out); }
    public static void main(String[] args) throws IOException{
        Main  d1=new Main   ();d1.main();d1.flush();
    }
    void main() throws IOException {
        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        PrintWriter out = new PrintWriter(System.out);
        int t=1;
     //   t=i(s()[0]);
        while(t-->0) {
                String[] s1=s();
                int n=i(s1[0]);
                long move=i(s1[1]);long rotate=i(s1[2]);long money=i(s1[3]);
                 char[] a=s()[0].toCharArray();
                 long[] suf=new long[n];
                 long paisa=move;
                 for(int i=n-1;i>=0;i--){
                     if(a[i]=='w') paisa+=rotate;
                     paisa+=1;
                     suf[i]=paisa;
                     paisa+=move;
                 }paisa=0;
                  long[] pre=new long[n];
                 for(int i=0;i<n;i++){
                   if(a[i]=='w') paisa+=rotate;
                     paisa+=1;
                     pre[i]=paisa;
                    paisa+=move;
                  }
                  paisa=0;

            long ans=0;
                 for(int i=0;i<n;i++){
                     if(a[i]=='w') paisa+=rotate;
                     paisa+=1;
                     long rem=money-paisa-(i)*move;
                     if(money-paisa>=0) ans=Math.max(ans,i+1);
//                     if(rem<0) break;;
                     int l=i+1;int h=n-1;
                     int ind=n;
                     while(l<=h){
                         int mid=(l+h)/2;
                         if(suf[mid]<=rem){
                             ind=mid;h=mid-1;
                         }else l=mid+1;
                     }
//                     System.out.println(rem+" "+ind);
                   if(rem>0)  ans=Math.max(ans,i+1+n-ind);
                     paisa+=move;
                  //   System.out.println(i+" "+ind+" "+rem+" "+paisa+" "+ans );
                 }
//            System.out.println(ans);
                 paisa=move;
                 for(int i=n-1;i>=0;i--){
                     if(a[i]=='w') paisa+=rotate;
                     paisa+=1;
                     if(money-paisa>=0) ans=Math.max(ans,n-i);
                     long rem=money-paisa-(n-i)*move;
//                     if(rem<0) break;
                     int l=0;int h=i-1;
                     int ind=-1;
                     while(l<=h){
                         int mid=(l+h)/2;
                         if(pre[mid]<=rem){
                             ind=mid;l=mid+1;
                         }else h=mid-1;
                     }
                  if(rem>=0)   ans=Math.max(ans,n-i+ind+1);paisa+=move;
                 }
            System.out.println(ans);
        }
    }TreeMap<Long,Integer> tm;
    int[] pathCompression(long[] a){
        int n=a.length;
        int[] compressed=new int[n];
        class Pair1{ long orgVal;int indexBeforeSorting; public Pair1(long a,int b){orgVal=a;indexBeforeSorting=b;}}
        Pair1[] p=new Pair1[n];
        for(int i=0;i<n;i++){
            p[i]=new Pair1(a[i],i);
        }int pre=0;
        Arrays.sort(p, new Comparator<Pair1>() {@Override public int compare(Pair1 o1, Pair1 o2) { if(o1.orgVal<o2.orgVal) return -1; else if(o1.orgVal==o2.orgVal) return 0; return 1; }});
        for(int i=0;i<p.length;i++){if(i==0||p[i].orgVal==p[i-1].orgVal) compressed[p[i].indexBeforeSorting]=pre; else {compressed[p[i].indexBeforeSorting]=++pre;}

        }
        return compressed;
    }
    long[] st;//new long[4*n];
    long query(int i,int s,int e,int qs,int qe){
        if(qs>e||qe<s) return Integer.MAX_VALUE;
        if(s>=qs&&e<=qe) return st[i];
        int mid=(s+e)/2;
        long l=query(2*i,s,mid,qs,qe);
        long r=query(2*i+1,mid+1,e,qs,qe);
        return Math.min(l,r);
    }
    void pointupdate(int i,int s,int e,int qi,long  a){
        if(s==e){
            st[i]=(a);return;
        }
        int mid=(s+e)/2;
        if(qi<=mid) pointupdate(2*i,s,mid,qi,a);
        else pointupdate(2*(i)+1,mid+1,e,qi,a);
        st[i]=Math.min(st[2*i],st[2*i+1]);
    }
    static long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
     static String[] s() throws IOException {
        return s.readLine().trim().split("\\s+");
    }
    static int i(String ss) {
        return Integer.parseInt(ss);
    }
    static long l(String ss) {
        return Long.parseLong(ss);
    }
    public void arr(long[] a,int n) throws IOException {
        //        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
        String[] s2=s();
        for(int i=0;i<n;i++){
            a[i]=l(s2[i]);
        }
    }
    public void arri(int[] a,int n) throws IOException{
        //        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
        String[] s2=s();
        for(int i=0;i<n;i++){
            a[i]=i(s2[i]);
        }
    }
    public void sort(int[] a,int l,int h){
        if(l==h) return;
        int mid=(l+h)/2;

        sort(a,l,mid);
        sort(a,mid+1,h);
        merge(a,l,(l+h)/2,h);
    }
    void merge(int arr[], int l, int m, int r) {
        int n1 = m - l + 1;
        int n2 = r - m;
        int L[] = new int[n1];
        int R[] = new int[n2];
        for (int i = 0; i < n1; ++i)
            L[i] = arr[l + i];
        for (int j = 0; j < n2; ++j)
            R[j] = arr[m + 1 + j];
        int i = 0, j = 0;
        int k = l;
        while (i < n1 && j < n2) {
            if (L[i] <= R[j]) {
                arr[k] = L[i];
                i++;
            }
            else {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        while (i < n1) {
            arr[k] = L[i];
            i++;
            k++;
        }
        while (j < n2) {
            arr[k] = R[j];
            j++;
            k++;
        }
    }
}
class Pair {
    long a;
    int b,c,d;
    public Pair(long a,int b){
        this.a=a;this.b=b;
        }
}class Sortbyroll implements Comparator<Pair> {
    public int compare(Pair a, Pair b)
    {
      return a.b-b.b;

    }}
