#include <bits/stdc++.h>
using namespace std;
int n, m, k, ans;
char v[2006][2006];
int T[2006][2006];
int nok;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++)
    for (int h = 1; h <= m; h++)
      scanf(" %c", &v[i][h]), nok += (v[i][h] == '.');
  if (k == 1) {
    printf("%d", nok);
    return 0;
  }
  for (int i = 1; i <= n; i++)
    for (int h = 1; h <= m; h++) T[i][h] = T[i][h - 1] + (v[i][h] == '.');
  for (int i = 1; i <= n; i++)
    for (int h = k; h <= m; h++) ans += (T[i][h] - T[i][h - k] == k);
  for (int i = 1; i <= n; i++)
    for (int h = 1; h <= m; h++) T[i][h] = 0;
  for (int i = 1; i <= n; i++)
    for (int h = 1; h <= m; h++) T[i][h] = T[i - 1][h] + (v[i][h] == '.');
  for (int i = k; i <= n; i++)
    for (int h = 1; h <= m; h++) ans += (T[i][h] - T[i - k][h] == k);
  printf("%d", ans);
}
