#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k, sm = 0;
  cin >> n >> m >> k;
  char t;
  vector<vector<int> > a(n + 1);
  vector<vector<int> > str(n + 1), stl(n + 1);
  for (int i = 0; i <= n; i++) {
    a[i].resize(m + 1);
    stl[i].resize(m + 1);
    str[i].resize(m + 1);
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      a[i][j] = 0;
      str[i][j] = 0;
      stl[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> t;
      if (t == '.') {
        a[i][j] = 1;
        sm++;
      }
      str[i][j] += str[i][j - 1] + a[i][j];
      stl[i][j] += stl[i - 1][j] + a[i][j];
    }
  }
  long long ts = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i + k - 1 <= n && stl[i + k - 1][j] - stl[i - 1][j] == k) {
        ts++;
      }
      if (j + k - 1 <= m && str[i][j - 1 + k] - str[i][j - 1] == k) {
        ts++;
      }
    }
  }
  if (k == 1)
    cout << sm;
  else
    cout << ts;
}
