#include using namespace std; #define F first #define S second #define R cin>> #define Z class #define ll long long #define ln cout<<'\n' #define in(a) insert(a) #define pb(a) push_back(a) #define pd(a) printf("%.10f\n",a) #define mem(a) memset(a,0,sizeof(a)) #define all(c) (c).begin(),(c).end() #define iter(c) __typeof((c).begin()) #define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--) #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++) #define rep(i,n) REP(i,0,n) #define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++) templatevoid pr(A a){cout<void pr(A a,B b){cout<void pr(A a,B b,C c){cout<void pr(A a,B b,C c,D d){cout<void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<=0&&x=0&&y P; int d[26][2111][2111]; string s[2222]; void init(ll n,ll m) { rep(k,26) { rep(i,n+1)rep(j,m) d[k][i][j+1]+=d[k][i][j]; rep(j,m+1)rep(i,n) d[k][i+1][j]+=d[k][i][j]; } } int calc(ll x1,ll y1,ll x2,ll y2,ll k) {return d[k][x2][y2]-d[k][x1][y2]-d[k][x2][y1]+d[k][x1][y1];} void Main() { ll n,m,t; cin >> n >> m >> t; rep(i,n) cin >> s[i]; rep(i,n)rep(j,m) d[s[i][j]-'a'][i+1][j+1]++; init(n,m); ll ans=0; for(ll i=0; i=t) { x2++; y2++; } else f2=0; if(c3>=t+1) { x3++; y3++; } else f3=0; } ans+=x2-x3; } } pr(ans); } int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}