#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int N = (int)1e6 + 7, mod = 1000000007, M = 2e9;
int n, m, k, c;
string s[2007];
long long ans;
long long calc(int n) {
  if (n < k) return 0;
  return n - k + 1;
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    c = 0;
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '.')
        c++;
      else
        ans += calc(c), c = 0;
    }
    ans += calc(c), c = 0;
  }
  for (int i = 0; i < m; i++) {
    c = 0;
    for (int j = 0; j < n; j++) {
      if (s[j][i] == '.')
        c++;
      else
        ans += calc(c), c = 0;
    }
    ans += calc(c), c = 0;
  }
  if (k == 1) ans >>= 1;
  cout << ans;
  return 0;
}
