#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using Pll = pair; using Pii = pair; constexpr ll MOD = 1000000007; constexpr long double EPS = 1e-10; constexpr int dyx[4][2] = { { 0, 1}, {-1, 0}, {0,-1}, {1, 0} }; int main() { std::ios::sync_with_stdio(false); cin.tie(0); int h,w,k; cin >> h >> w >> k; vector> a(h+1, vector(w+1, -1)); for(int i=1;i<=h;++i) { string s; cin >> s; for(int j=1;j<=w;++j) { a[i][j] = int(s[j-1] - 'a'); } } int ans = 0; for(int i=1;i<=h;++i) { for(int j=1;j<=w;++j) { vector c(26, 0); int level = 0; for(int r=1;r<=min(h-i+1, w-j+1);++r) { for(int jj=j;jj