#include <bits/stdc++.h>
using namespace std;
namespace fastIO {
template <typename T>
inline T read() {
  T f = 1, x = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
template <typename T>
inline void write(T x) {
  if (!x) {
    putchar('0');
    return;
  }
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
}  // namespace fastIO
using namespace fastIO;
namespace fastOutput {
template <typename T>
inline void print_char(T x, char ch) {
  write(x), putchar(ch);
}
template <typename T>
inline void char_print(char ch, T x) {
  putchar(ch);
  write(x);
}
template <typename T>
inline void print_space(T x) {
  print_char(x, ' ');
}
template <typename T>
inline void space_print(T x) {
  char_print(' ', x);
}
template <typename T>
inline void println(T x) {
  print_char(x, '\n');
}
template <typename T>
inline void lnprint(T x) {
  char_print('\n', x);
}
template <typename T>
inline void print_array1(T *a, int n) {
  for (int(i) = (1); (i) <= (n); ++(i)) print_char(a[i], " \n"[i == n]);
}
template <typename T>
inline void print_array2(T *a, int n) {
  println(n), print_array1(a, n);
}
template <typename T>
inline void print_array3(T *a, int n) {
  for (int(i) = (n); (i) >= (1); --(i)) print_char(a[i], " \n"[i == 1]);
}
template <typename T>
inline void print_array4(T *a, int n) {
  println(n), print_array3(a, n);
}
template <typename T>
inline void print_array_in_range1(T *a, int l, int r) {
  for (int(i) = (l); (i) <= (r); ++(i)) print_char(a[i], " \n"[i == r]);
}
template <typename T>
inline void print_array_in_range2(T *a, int l, int r) {
  for (int(i) = (r); (i) >= (l); --(i)) print_char(a[i], " \n"[i == l]);
}
template <typename T>
inline void print_array_in_range3(T *a, int l, int r) {
  for (int(i) = (l); (i) <= (r); ++(i)) println(a[i]);
}
template <typename T>
inline void print_array_in_range4(T *a, int l, int r) {
  for (int(i) = (r); (i) >= (l); --(i)) println(a[i]);
}
template <typename T>
inline void special_print_array1(T *a, int n) {
  print_space(n), print_array1(a, n);
}
template <typename T>
inline void special_print_array2(T *a, int n) {
  print_space(n), print_array3(a, n);
}
inline void print_string_in_range(string s, int l, int r) {
  for (int(i) = (l); (i) <= (r); ++(i)) putchar(s[i]);
}
inline void print_chars_in_range(char *a, int l, int r) {
  for (int(i) = (l); (i) <= (r); ++(i)) putchar(a[i]);
}
template <typename T>
inline void vector_print(vector<T> a, int l, int r) {
  for (int(i) = (l); (i) <= (r); ++(i)) print_char(a[i], " \n"[i == r]);
}
template <typename T>
inline void map_print(map<T, T> a, int l, int r) {
  for (int(i) = (l); (i) <= (r); ++(i)) print_char(a[i], " \n"[i == r]);
}
template <typename T>
inline void stack_print(stack<T> a) {
  while (!a.empty()) write(a.top()), a.pop();
}
template <typename T>
inline void queue_print(queue<T> a) {
  while (!a.empty()) write(a.front()), a.pop();
}
template <typename T>
inline void pq_print(priority_queue<T> a) {
  while (!a.empty()) write(a.top()), a.pop();
}
}  // namespace fastOutput
using namespace fastOutput;
char a[2007][2007];
int main() {
  int n = read<int>(), m = read<int>(), k = read<int>(), ans = 0;
  for (int(i) = (1); (i) <= (n); ++(i)) scanf("%s", a[i] + 1);
  for (int(i) = (1); (i) <= (n); ++(i)) {
    int cnt = 0;
    for (int(j) = (1); (j) <= (m); ++(j)) {
      if (a[i][j] == '.')
        cnt++;
      else
        ans += max(0, cnt - k + 1), cnt = 0;
    }
    ans += max(0, cnt - k + 1);
  }
  for (int(j) = (1); (j) <= (m); ++(j)) {
    int cnt = 0;
    for (int(i) = (1); (i) <= (n); ++(i)) {
      if (a[i][j] == '.')
        cnt++;
      else
        ans += max(0, cnt - k + 1), cnt = 0;
    }
    ans += max(0, cnt - k + 1);
  }
  return write(ans / (k == 1 ? 2 : 1)), 0;
}
