#include<bits/stdc++.h>
using namespace std;
char a[100][100];
int b[105][105];
int main(){
int n,m,l,d,min1=9999999;
cin>>n>>m>>l;
for(int i=1;i<=n;i++){
cin>>a[i];
for(int j=1;j<=m;j++){
if(a[i][j-1]!='0'){
b[i][j]++;
}
b[i][j]+=b[i][j-1]+b[i-1][j]-b[i-1][j-1];
}
}
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
for(int i1=i;i1<=n+1;i1++){
for(int j1=j;j1<=m+1;j1++){
d=b[i1][j1]-b[i-1][j1]-b[i1][j-1]+b[i-1][j-1];;
if(d>=l&&((i1-i+1)*(j1-j+1))<min1){
min1=((i1-i+1)*(j1-j+1));
}
}
}
}
}
if(min1==9999999){
cout<<0;
return 0;
}
cout<<min1;
}