#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define sz size() #define pb push_back #define mp make_pair #define fi first #define se second #define all(c) (c).begin(), (c).end() #define rep(i,a,b) for(int i=(a);i<(b);++i) #define clr(a, b) memset((a), (b) ,sizeof(a)) #define MOD 1000000007 // 愚直解(想定誤解法) string s; int main(){ cin>>s; int m; cin>>m; int ans = 0; rep(i,0,m){ string s1; cin>>s1; rep(i,0,max(0,(int)(s.sz-s1.sz)+1)){ int flag = 1; rep(j,0,s1.sz){ if(s[i+j]!=s1[j]){ flag = 0; break; } } if(flag == 1)ans++; } } cout << ans << endl; return 0; }