#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > cols, lines;
int getCol(int x, int y) {
  if (x >= 0 && y >= 0) return cols[x][y];
  return 0;
}
int getLine(int x, int y) {
  if (x >= 0 && y >= 0) return lines[x][y];
  return 0;
}
void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  cols.resize(n, vector<int>(m));
  lines.resize(n, vector<int>(m));
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < m; ++j) {
      int has = (s[j] == '.');
      cols[i][j] = has + (i > 0 ? cols[i - 1][j] : 0);
      lines[i][j] = has + (j > 0 ? lines[i][j - 1] : 0);
    }
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      ans += (cols[i][j] - getCol(i - k, j) == k);
      ans += (lines[i][j] - getLine(i, j - k) == k);
    }
  }
  if (k == 1) {
    cout << ans / 2 << endl;
  } else {
    cout << ans << endl;
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
