#include <bits/stdc++.h>
using namespace std;
string rows[2010], col[2010];
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  int aux = 0;
  for (int i = 0; i < n; i++) {
    getchar();
    for (int j = 0; j < m; j++) {
      char c;
      scanf("%c", &c);
      rows[i] += c;
      col[j] += c;
      if (c == '.') aux++;
    }
  }
  if (k == 1) {
    return 0 * printf("%d\n", aux);
  }
  int ans = 0;
  for (int i = 0; i < n && k <= m; i++) {
    int cnt = 0;
    for (int j = 0; j < m; j++) {
      if (rows[i][j] == '.')
        cnt++;
      else {
        ans += max(0, cnt - k + 1);
        cnt = 0;
      }
    }
    ans += max(0, cnt - k + 1);
  }
  for (int i = 0; i < m && k <= n; i++) {
    int cnt = 0;
    for (int j = 0; j < n; j++) {
      if (col[i][j] == '.')
        cnt++;
      else {
        ans += max(0, cnt - k + 1);
        cnt = 0;
      }
    }
    ans += max(0, cnt - k + 1);
  }
  printf("%d\n", ans);
  return 0;
}
