#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  int free_spots = 0;
  char matrix[2002][2002];
  string fila;
  long long ways = 0;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    cin >> fila;
    for (int j = 0; j < m; j++) {
      matrix[i][j] = fila[j];
      if (fila[j] == '.') free_spots++;
    }
  }
  for (int i = 0; i < n; i++) {
    long long free_seats = 0;
    for (int j = 0; j < m; j++) {
      if (matrix[i][j] == '.') {
        free_seats++;
      } else {
        if (free_seats >= k) {
          ways += (free_seats - k + 1);
        }
        free_seats = 0;
      }
    }
    if (free_seats >= k) {
      ways += (free_seats - k + 1);
      free_seats = 0;
    }
  }
  for (int j = 0; j < m; j++) {
    long long free_seats = 0;
    for (int i = 0; i < n; i++) {
      if (matrix[i][j] == '.') {
        free_seats++;
      } else {
        if (free_seats >= k) {
          ways += (free_seats - k + 1);
        }
        free_seats = 0;
      }
    }
    if (free_seats >= k) {
      ways += (free_seats - k + 1);
      free_seats = 0;
    }
  }
  if (k == 1) {
    printf("%d\n", free_spots);
  } else {
    printf("%lld\n", ways);
  }
  return 0;
}
