#include #include #include using namespace std; const long long int BASE=37; const long long int MOD=10000007; struct RollingHush { vector hash; vector power; RollingHush(string s) : hash(s.size()+1), power(s.size()+1) { hash[0] = 0; power[0] = 1; for(int i=0; i> str; RollingHush rh_str(str); int M; cin >> M; int ans=0; for(int i=0; i> cmp; RollingHush rh_cmp(cmp); for(int si=0; si+cmp.size()<=str.size(); si++) { if(rh_str.get(si, si+cmp.size())==rh_cmp.get(0, cmp.size())) ans++; } } cout << ans << endl; return 0; }