#include <bits/stdc++.h>
const int N = 2018;
char s[N][N];
int main() {
  int n, m, k, ans = 0;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1, ret = 0; j <= m + 1; j++)
      if (s[i][j] == '.')
        ++ret;
      else {
        if (ret >= k) ans += ret - k + 1;
        ret = 0;
      }
  if (k != 1)
    for (int i = 1; i <= m; i++)
      for (int j = 1, ret = 0; j <= n + 1; j++)
        if (s[j][i] == '.')
          ++ret;
        else {
          if (ret >= k) ans += ret - k + 1;
          ret = 0;
        }
  printf("%d", ans);
}
