#include using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 1000000000 struct trie{ struct node{ vector next; int str=-1; node(int k){ next.resize(k,-1); } }; vector _N; vector _S; int n; trie(int k){ n = k; _N.push_back(node(n)); } void add(string s){ int now = 0; for(int i=0;i>S; int M; cin>>M; trie T(26); for(int i=0;i>s; T.add(s); } int ans = 0; for(int i=1;i<=10;i++){ for(int j=0;j+i<=S.size();j++){ int ret = T.check(S.substr(j,i)); if(ret!=-1)ans++; } } cout<