#include<cstdio>
#include<iostream>
using namespace std;
int f[501][501][101];
int rf,cf,rs,cs,n,m,t;
char c[501][501];
int main()
{
freopen("ctravel.in","r",stdin);
freopen("ctravel.out","w",stdout);
scanf("%d%d%d",&n,&m,&t);
for (int i=1; i<=n; ++i)
for (int j=1; j<=m; ++j)
cin>>c[i][j];
scanf("%d%d%d%d",&rf,&cf,&rs,&cs);
f[rf][cf][0]=1;
for (int k=1; k<=t; ++k)
for (int i=1; i<=n; ++i)
for (int j=1; j<=m; ++j)
if (c[i][j]!='*')
f[i][j][k]=f[i-1][j][k-1]+f[i][j-1][k-1]+f[i+1][j][k-1]+f[i][j+1][k-1];
printf("%d\n",f[rs][cs][t]);
}