#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(false);
int n,m,k,ans=0;
cin>>n>>m>>k;
char map[n+k*2][m+k*2];
for(int i=k;i<n+k;i++){
for(int j=k;j<m+k;j++)cin>>map[i][j];
}
for(int i=k;i<n;i++)for(int j=k;j<m;j++)
if(map[i][j]=='#')
for(int f=0;f<=k;f++)for(int l=0;l<=k;l++){
if(map[i+f][j+l]!='#')map[i+f][j+l]='1';
if(map[i-f][j-l]!='#')map[i-f][j-l]='1';
}
for(int i=0;i<n+k*2;i++){
for(int j=0;j<m+k*2;j++)if(map[i][j]=='1')ans++;
}
cout<<ans;
return 0;
}