#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) {
    v.emplace_back(x);
  }
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << ", ";
  err(++it, args...);
}
string mat[2002];
int get(string str, int x) {
  int i, cnt = 0, w = 0;
  for (i = 0; i < str.size(); ++i) {
    if (str[i] == '.')
      cnt++;
    else
      cnt = 0;
    if (cnt >= x) w++;
  }
  return w;
}
int main() {
  int n, m, k, i, j, cnt = 0;
  cin >> n >> m >> k;
  for (i = 0; i < n; ++i) cin >> mat[i];
  for (i = 0; i < n; ++i) {
    string str = mat[i];
    cnt += get(str, k);
  }
  for (i = 0; i < m; ++i) {
    string str;
    for (j = 0; j < n; ++j) str += mat[j][i];
    cnt += get(str, k);
  }
  if (k == 1) cnt >>= 1;
  cout << cnt << endl;
  return 0;
}
