#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:16777216")
#pragma warning(disable : 4786)
long long dp[2002][2001];
long long ncr(int n, int r) {
  if (r == 1) return n;
  if (n == r) return 1;
  if (dp[n][r] != -1)
    return dp[n][r];
  else {
    dp[n][r] = ncr(n - 1, r - 1) + ncr(n - 1, r);
  }
  return dp[n][r];
}
int main() {
  memset(dp, -1, sizeof(dp));
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> ans;
  char A[n][m];
  int Nc[n][m];
  int Nr[n][m];
  memset(Nc, 0, sizeof(Nc));
  memset(Nr, 0, sizeof(Nr));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> A[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    for (int j = 0; j < m; j++) {
      if (A[i][j] == '.') {
        cnt++;
      } else {
        Nr[i][j] = cnt;
        cnt = 0;
      }
      if (j == m - 1 && cnt) Nr[i][j] = cnt;
    }
  }
  for (int i = 0; i < m; i++) {
    int cnt = 0;
    for (int j = 0; j < n; j++) {
      if (A[j][i] == '.') {
        cnt++;
      } else {
        Nc[j][i] = cnt;
        cnt = 0;
      }
      if (j == n - 1 && cnt) Nc[j][i] = cnt;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (Nr[i][j] >= k) ans.push_back(Nr[i][j]);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (Nc[i][j] >= k) ans.push_back(Nc[i][j]);
    }
  }
  long long res = 0;
  sort(ans.begin(), ans.end());
  if (k > 1) {
    for (int i = ans.size() - 1; i >= 0; i--) {
      res += (ans[i] - k + 1);
    }
  } else {
    res = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        res += (Nc[i][j]);
        res += (Nr[i][j]);
      }
    }
    res /= 2;
  }
  cout << res << endl;
  return 0;
}
