#include <bits/stdc++.h>
using namespace std;
char store[2005][2005];
int main(void) {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < (n); ++i) scanf("%s", store[i]);
  int ret = 0;
  if (k == 1) {
    for (int i = 0; i < (n); ++i)
      for (int j = 0; j < (m); ++j)
        if (store[i][j] == '.') ret++;
    printf("%d", ret);
    return 0;
  }
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (m - k + 1); ++j) {
      if (store[i][j] == '.') {
        bool flag = 1;
        int e = j;
        for (int l = (j + 1); l < (j + k); ++l) {
          if (store[i][l] != '.') {
            flag = 0;
            e = l;
            break;
          }
        }
        if (flag) {
          ret++;
          for (int l = (j + k); l < (m + 1); ++l) {
            if (l == m) {
              e = m;
              break;
            }
            if (store[i][l] != '.') {
              e = l;
              break;
            }
            ret++;
          }
        }
        j = e;
      }
    }
  }
  for (int i = 0; i < (m); ++i) {
    for (int j = 0; j < (n - k + 1); ++j) {
      if (store[j][i] == '.') {
        bool flag = 1;
        int e = j;
        for (int l = (j + 1); l < (j + k); ++l) {
          if (store[l][i] != '.') {
            flag = 0;
            e = l;
            break;
          }
        }
        if (flag) {
          ret++;
          for (int l = (j + k); l < (n + 1); ++l) {
            if (l == n) {
              e = n;
              break;
            }
            if (store[l][i] != '.') {
              e = l;
              break;
            }
            ret++;
          }
        }
        j = e;
      }
    }
  }
  printf("%d", ret);
  return 0;
}
