#pragma GCC optimize("Ofast") #include using namespace std; //#include //#include //namespace mp=boost::multiprecision; //#define mulint mp::cpp_int //#define mulfloat mp::cpp_dec_float_100 struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<=0;(i)--) #define Flag(x) (1<<(x)) #define Flagcount(x) __builtin_popcountll(x) #define pint pair #define pdouble pair #define plint pair #define fi first #define se second typedef long long lint; typedef unsigned long long ull; int dx[8]={1,1,0,-1,-1,-1,0,1}; int dy[8]={0,1,1,1,0,-1,-1,-1}; const int MAX_N=2e5+5; //struct edge{lint to,num;}; //vector bucket[MAX_N/1000]; int contain(string A,string B){ //AがBに含まれているか int al=A.length(),bl=B.length(); int res=0; if(al>bl) return 0; ull t=1; rep(i,al) t*=MOD; ull ah=0,bh=0; rep(i,al) ah=ah*MOD+A[i]; rep(i,al) bh=bh*MOD+B[i]; for(int i=0;i+al<=bl;i++){ if(ah==bh) res++; if(i+al> S; int Q; cin >> Q; int ans=0; while(Q--){ string T; cin >> T; ans+=contain(T,S); } cout << ans << endl; }