#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //eolibraries #define lnf 3999999999999999999 #define inf 999999999 #define PI 3.14159265359 #define endl "\n" #define fi first #define se second #define pb push_back #define eb emplace_back #define ll long long #define all(c) (c).begin(),(c).end() #define sz(c) (int)(c).size() #define mkp(a,b) make_pair(a,b) #define make_unique(a) sort(all(a)),a.erase(unique(all(a)),a.end()) #define rsz(a,n) a.resize(n) #define pii pair #define rep(i,n) for(int i = 0 ; i < n ; i++) #define drep(i,n) for(int i = n-1 ; i >= 0 ; i--) #define crep(i,x,n) for(int i = x ; i < n ; i++) #define vi vector #define vec(...) vector<__VA_ARGS__> #define rsz(a,n) a.resize(n) #define rszv(a,n,v) a.resize(n,v) #define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); //eodefine using namespace std; const int max_n = 603002; int n,a,b,c; vi x; int main(){ fcin; cin>>n>>a>>b>>c; rep(i,n) { string s; cin>>s; x.pb(sz(s)); } vec(ll) psum(max_n,0); rep(i,n) psum[i]=(i-1>=0?psum[i-1]:0)+x[i]; vi np={0,0,0}; ll ans=0; rep(i,n) { while(np[0]=0?psum[i-1]:0)=n)continue; if(psum[np[0]]-(i-1>=0?psum[i-1]:0)==a and psum[np[1]]-psum[np[0]]==b and np[2]