#include #include #include using namespace std; int main(){ string S; cin >> S; int M; cin >> M; int ans = 0; int len = S.size(); for( int i = 0 ; i < M; i++){ string C; cin >> C; int size=C.size(); long long hash=0; long long offset=1LL; for( int j = 0 ; j < size; j++ ){ hash*=26; hash+=C[j]-'A'; offset*=26; } long long curHash=0; for( int j =0; j+1