#include <iostream>#include <string>using namespace std;int main(void){ int H, W, h, w; char pic[100][100], pot[100][100]; while(cin >> H >> W >> h >> w) { for(int i = 0; i != H; ++i) cin >> pic[i]; for(int i = 0; i != h; ++i) cin >> pot[i]; int cnt = 0; for(int i = 0; i+h <= H; ++i) for(int j = 0; j+w <= W; ++j) { bool match = 1; for(int k = 0; k != h; ++k) { for(int l = 0; l != w; ++l) { if(pot[k][l] != '.' && pic[i+k][j+l] != pot[k][l]) { match = 0; break; } } if(match == 0) break; } if(match) ++cnt; } cout << cnt << endl; } }