#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

typedef bitset<800>bs;
bs X;
int H,W,h,w;

int A[888][888];
int a[888][888];

bs latte[888];

bs malta[888][62];

int conv(char c){
   if(isupper(c))return c-'A';
   if(islower(c))return 26+c-'a';
   if(isdigit(c))return 52+c-'0';
   return -1;
}

signed main(){
    cin>>W>>H>>w>>h;

    rep(i,H){
        string s;cin>>s;
        rep(j,W)A[i][j]=conv(s[j]);
    }

    rep(i,h){
        string s;cin>>s;
        rep(j,w)a[i][j]=conv(s[j]);
    }

    rep(i,W)X[i]=1;

    rep(i,H)latte[i]=X;

    rep(i,H)rep(j,W)if(i+h>H||j+w>W)latte[i][j]=0;

    rep(i,H){
        rep(j,W){
            if(A[i][j]>=0)malta[i][A[i][j]][j]=1;
            else rep(k,62)malta[i][k][j]=1;
        }
    }

    for(int j=0;j<h;j++){
        for(int i=j;i<H;i++){
            for(int k=0;k<w;k++){
                if(a[j][k]>=0)latte[i-j]&=malta[i][a[j][k]]>>k;
            }
        }
    }

    int ans=0;
    rep(i,H)rep(j,W)ans+=latte[i][j];
    cout<<ans<<endl;
    return 0;
}