#define rep(i, n) for(int i = 0; i < (int)(n); i++) typedef int ll; #include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); ll h,w,K; std::cin >> h>>w>>K; std::vector s(h); // ll sum[26][2001][2001]; vector>> sum(26,vector>(h+1,vector(w+1))); for (int i = 0; i < h; i++) { std::cin >> s[i]; for (int j = 0; j < w; j++) { int alpha = s[i][j]-'a'; for (int k = 0; k < 26; k++) { sum[k][i+1][j+1] = sum[k][i][j+1] + sum[k][i+1][j] - sum[k][i][j]; } sum[alpha][i+1][j+1]++; } } ll result = 0; for (int i = 0; i < h; i++) { ll csize = 1; for (int j = 0; j < w; j++) { for (int size = csize; i+size0){ num++; } } if(num==K){ result++; if(first){ csize = size-1; // std::cout << i<<" "<K){ if(first){ csize = min(1,size-1); } break; } } } } std::cout << result << std::endl; }