rt
#include <bits/stdc++.h>
using namespace std;
int s[500][500];
int a,b,c,ans;
void right(int x,int y,int q)
{
if (q==c)
{
ans++;
return ;
}
if (s[x][y+1]==1)
{
right(x,y+1,q+1);
}
}
void under(int x,int y,int q)
{
if (q==c)
{
ans++;
return ;
}
if (s[x+1][y]==1)
{
right(x+1,y,q+1);
}
}
int main(int argc, char** argv) {
int i,j;
char p;
cin>>a>>b>>c;
for (i=0;i<a;i++)
{
for (j=0;j<b;j++)
{
cin>>p;
if (p=='#')
{
s[i][j]=0;
}
else
{
s[i][j]=1;
}
}
}
for (i=0;i<a;i++)
{
for (j=0;j<b;j++)
{
if (s[i][j]==1)
{
right(i,j,1);
under(i,j,1);
}
}
}
if (c==1)
{
ans/=2;
}
cout<<ans;
return 0;
}