Suppose that you are in a campus and have to go for classes day by day. As you may see, when you hurry to a classroom, you surprisingly find that many seats there are already occupied. Today you and your friends went for class, and found out that some of the seats were occupied.

The classroom contains $n$ rows of seats and there are $m$ seats in each row. Then the classroom can be represented as an $n \times m$ matrix. The character '.' represents an empty seat, while '*' means that the seat is occupied. You need to find $k$ consecutive empty seats in the same row or column and arrange those seats for you and your friends. Your task is to find the number of ways to arrange the seats. Two ways are considered different if sets of places that students occupy differs.


-----Input-----

The first line contains three positive integers $n,m,k$ ($1 \leq n, m, k \leq 2\,000$), where $n,m$ represent the sizes of the classroom and $k$ is the number of consecutive seats you need to find.

Each of the next $n$ lines contains $m$ characters '.' or '*'. They form a matrix representing the classroom, '.' denotes an empty seat, and '*' denotes an occupied seat.


-----Output-----

A single number, denoting the number of ways to find $k$ empty seats in the same row or column.


-----Examples-----
Input
2 3 2
**.
...

Output
3

Input
1 2 2
..

Output
1

Input
3 3 4
.*.
*.*
.*.

Output
0



-----Note-----

In the first sample, there are three ways to arrange those seats. You can take the following seats for your arrangement.   $(1,3)$, $(2,3)$  $(2,2)$, $(2,3)$  $(2,1)$, $(2,2)$

Difficulty: interview

Starter code:

Solutions:
n, m, k = list(map(int, input().split()))
a = [[0] * m for x in range(n)]
s = []
count = 0
for i in range(n):
    s.append(input())
for i in range(n):
    y = 0
    for j in range(m):
        if s[i][j] == ".":
            if(a[i][j] + 1 >= k and k > 1):
                count += 1
            y +=1
            if y >= k:
                count += 1
            if i + 1 < n:
                a[i + 1][j] = a[i][j] + 1
        else:
            y = 0
            
print(count)


n, m, k = list(map(int, input().split()))
a = []
ans = 0
for i in range(n):
    s = input()
    a.append(s)
    kk = 0
    for i in s:
        if i == '.':
            kk += 1
            if kk >= k:
                ans += 1
        else:
            kk = 0
for j in range(m):
    kk = 0
    for i in a:
        if i[j] == '.':
            kk += 1
            if kk >= k:
                ans += 1
        else:
            kk = 0
if k == 1:
    print(ans // 2)
else:
    print(ans)


n, m, k = list(map(int, input().split()))

result = 0

M1 = []
for _ in range(n):
    M1.append(list([x == '*' for x in input()]))

M2 = [[M1[j][i] for j in range(n)] for i in range(m)]

#print(M2)

for M in ([M1, M2] if k > 1 else [M1]):
    for row in M:
        cnts = []
        sofar = 0
        for seat in row:
            if not seat:
                sofar += 1
            else:
                cnts.append(sofar)
                sofar = 0
        cnts.append(sofar)
        #print(cnts)

        for cnt in cnts:
            result += max(0, cnt-k+1)

print(result)


def main():
    n, m, k = map(int, input().split())
    g = []
    for i in range(n):
        g.append(input())
    ans = 0
    if k == 1:
        cnt = 0
        for i in range(n):
            for j in range(m):
                cnt += 1 if g[i][j] == '.' else 0
        print(cnt)
        return
    # count row
    for i in range(n):
        cnt = 0
        for j in range(m):
            if g[i][j] == '.':
                cnt += 1
                if cnt >= k:
                    ans += 1
            else:
                cnt = 0
    for j in range(m):
        cnt = 0
        for i in range(n):
            if g[i][j] == '.':
                cnt += 1
                if cnt >= k:
                    ans += 1
            else:
                cnt = 0
    print(ans)


def __starting_point():
    main()
__starting_point()

nr, nc, k = map(int, input().strip().split())

#print(nr, nc, k)

total = 0

cols = [0] * nc
for r in range(nr):
    row = input().strip()

    for i, e in enumerate(row):
        if e == '*':  # occupied
            total += max(0, cols[i] - k + 1)
            cols[i] = 0
        else:
            cols[i] += 1

    #segments = [len(s) for s in row.split('*') if s]
    #ways = [max(0, x - k + 1) for x in segments]
    #total += sum(ways)

    total += sum(max(0, len(s) - k + 1) for s in row.split('*') if s)
total += sum(max(0, x - k + 1) for x in cols)
if k == 1:
    total //= 2
print(total)

n, m, k = list(map(int, input().split()))
f = [[x == '.' for x in input()] for _ in range(n)]
if k == 1:
    print(sum(sum(x) for x in f))
    quit()

r = 0

for y in range(n):
    b, e = 0, 1
    for x in range(m):
        if f[y][x]:
            e += 1
        else:
            r += max(0, ((e - b) - k))
            b, e = x, x+1

    r += max(0, (e - b) - k)


for x in range(m):
    b, e = 0, 1
    for y in range(n):
        if f[y][x]:
            e += 1
        else:
            r += max(0, ((e - b) - k))
            b, e = x, x+1

    r += max(0, (e - b) - k)

print(r)


# import sys
# sys.stdin = open('in.txt', 'r')

n, m, k = list(map(int, input().split()))
d = [input() for _ in range(n)]

res = 0
for i in range(n):
    cs = 0
    for j in range(m):
        if d[i][j] == '.':
            cs += 1
        else:
            res += max(cs-k+1, 0)
            cs = 0

    res += max(cs-k+1, 0)

for j in range(m):
    cs = 0
    for i in range(n):
        if d[i][j] == '.':
            cs += 1
        else:
            res += max(cs-k+1, 0)
            cs = 0
    res += max(cs-k+1, 0)

if k == 1:
    print(res//2)
else:
    print(res)


n, m, k = [int(x) for x in input().split()]
lst=[]
v=0
for i in range(n):
    s = list(input())
    lst.append(s)
for i in range(n):
    z = 0
    for j in range(m):
            if lst[i][j]==".":
                z+=1
            else:
                z=0
            if z>=k:
                v+=1
for i in range(m):
    z=0
    for j in range(n):
        if lst[j][i]==".":
            z+=1
        else:
            z=0
        if z>=k:
            v+=1

if k==1: v=v/2
print(int(v))


n,m,k=list(map(int,input().split()))
a=[]
ans=0
for i in range(n):
    a.append(input())
if k==1:
    for i in range(n):
        for j in range(m):
            if a[i][j]=='.':
                ans+=1
    print(ans)
    return
for i in range(n):
    l=0
    for j in range(m):
        if a[i][j]=='.':
            l+=1
        else:
            ans+=max(0,l-k+1)
            l=0
    ans+=max(0,l-k+1)
for i in range(m):
    l=0
    for j in range(n):
        if a[j][i]=='.':
            l+=1
        else:
            ans+=max(0,l-k+1)
            l=0
    ans+=max(0,l-k+1)
print(ans)


import sys, math, os.path

FILE_INPUT = "c.in"
DEBUG = os.path.isfile(FILE_INPUT)
if DEBUG: 
    sys.stdin = open(FILE_INPUT)    

def ni():
    return list(map(int, input().split(" ")))

def nia(): 
    return list(map(int,input().split()))

def log(x):
    if (DEBUG):
        print(x)

n,m,k = ni()

m1 = []
for _ in range(n):
    m1.append(list([x == '.' for x in input()]))

# log(m1)

count = 0

if (k == 1):
    count = 0
    print(sum(x.count(True) for x in m1))
    return

for i in range(n):
    j = 0
    while (j < m):
        cd = 0
        while (j < m) and (not m1[i][j]):
            j += 1
        while (j < m) and (m1[i][j]):
            j += 1
            cd += 1
        if (k <= cd):
            count += cd - k + 1
            # log(f"i = {i}, {j-cd} -> {j}")

# log(f"count = {count}")   

for j in range(m):
    i = 0
    while (i < n):
        cd = 0
        while (i < n) and (not m1[i][j]):
            i += 1
        
        while (i < n) and (m1[i][j]):
            i += 1
            cd += 1

        if (k <= cd):
            count += cd - k + 1
            # log(f"j = {j}, {i-cd} -> {i}")
print(count)


n, m, k = (int(x) for x in input().split())

COLCON = [0 for _ in range(m)]

res = 0
for _ in range(n):
    con = 0

    for i, c in enumerate(input().strip()):
        if c == '*':
            con = 0
            COLCON[i] = 0

        else:
            con += 1
            if con >= k:
                res += 1

            COLCON[i] += 1
            if COLCON[i] >= k:
                res += 1

if k == 1:
    print(res // 2)
else:
    print(res)

s = input ()
s = s.strip().split (' ')
n = int (s[0])
m = int (s[1])
k = int (s[2])

mp = []

for i in range (n) :
	string = input ()
	temp = []
	for j in range (m) :
		temp.append (string[j])
	mp.append(temp)

ans = 0

for i in range (n) :
	begin = 0
	while begin < m :
		# print (begin)
		if (mp[i][begin] == '.') :
			temp = begin
			while mp[i][temp] == '.' :
				temp += 1
				if temp == m : break
			length = temp - begin
			begin = temp
			ans += max (0,length - k + 1)
		begin += 1

for i in range (m) :
	begin = 0
	while begin < n :
		if (mp[begin][i] == '.') :
			temp = begin
			while mp[temp][i] == '.' :
				temp += 1
				if temp == n : break
			length = temp - begin
			begin = temp
			ans += max (0,length - k + 1)
		begin += 1

if k == 1 :
	ans = 0
	for i in range (n) :
		for j in range (m) :
			if mp[i][j] == '.' :
				ans += 1


print (ans)

n,m,k = map(int, input().split())
a = []
for i in range(n):
    a.append(input())
ans = 0
for i in range(n):
    st = 0
    for j in range(m):
        if a[i][j] == '.':
            st += 1
            if st >= k:
                ans += 1
        else:
            st = 0
for i in range(m):
    st = 0
    for j in range(n):
        if a[j][i] == '.':
            st += 1
            if st >= k:
                ans += 1
        else:
            st = 0
if k == 1:
    print(int(ans/2))
else:
    print(ans)

import re

n, m, k = list(map(int, input().split()))
s = [input() for _ in range(n)]
if n > 1 and k > 1:
	t = list(["".join(x) for x in zip(*s)])
	s += t

ans = 0
p = re.compile(r"\.{" + str(k) + ",}")
for i in s:
	ans += sum([len(x) - k + 1 for x in p.findall(i)])
		
print(ans)


n, m, k = list(map(int, input().split()))
mat = []
for i in range(n):
    s = input()
    mat.append([])
    for j in range(m):
        if s[j] == '*':
            mat[i].append(0)
        else:
            mat[i].append(1)

ans = 0
for i in range(n):
    res = 0
    for j in range(m):
        if mat[i][j]:
            res += 1
            if res >= k:
                ans += 1
        else:
            res = 0

for i in range(m):
    res = 0
    for j in range(n):
        if mat[j][i]:
            res += 1
            if res >= k:
                ans += 1
        else:
            res = 0

if k == 1:
    ans //= 2

print (ans)


n, m, k = [int(x) for x in input().split()]
LL=['']*n
AllCount = 0
for i in range(n):
    LL[i] = input()

for i in range(n):
    length = 0
    for j in range(m):
        if LL[i][j]=='.':
            length+=1
        else:
            if length>=k:
                AllCount+=length-k+1
            length=0
    if length>=k:
        AllCount += length - k + 1
for j in range(m):
    length=0
    for i in range(n):
        if LL[i][j]=='.':
            length+=1
        else:
            if length>=k:
                AllCount+=length-k+1
            length=0
    if length >= k:
        AllCount += length - k + 1

if k==1:
    AllCount//=2
print(AllCount)

n, m, k = [int(x) for x in input().split()]
LL=['']*n
AllCount = 0
for i in range(n):
    LL[i] = input()
for i in range(n):
    length = 0
    for j in range(m):
        if LL[i][j]=='.':
            length+=1
        else:
            if length>=k:
                AllCount+=length-k+1
            length=0
    if length>=k:
        AllCount += length - k + 1
for j in range(m):
    length=0
    for i in range(n):
        if LL[i][j]=='.':
            length+=1
        else:
            if length>=k:
                AllCount+=length-k+1
            length=0
    if length >= k:
        AllCount += length - k + 1
if k==1:
    AllCount//=2
print(AllCount)

import sys


def count(class_map):
    result = 0

    for row in class_map:
        length = 0
        for seat in row:
            if seat == '.':
                length += 1
            else:
                if length >= k:
                    result += length - k + 1
                length = 0

        if length >= k:
            result += length - k + 1

    return result


n, m, k = list(map(int, sys.stdin.readline().split()))
class_map = [list(line.strip()) for line in sys.stdin]
result = 0

if k == 1:
    for row in class_map:
        for seat in row:
            if seat == '.':
                result += 1
    print(result)
    return


print(count(class_map) + count(list(zip(*class_map))))


import re

n, m, k = map(int, input().split())
s = [input() for _ in range(n)]
if n > 1 and k > 1:
    t = list(map(lambda x: "".join(x), zip(*s)))
    s += t

ans = 0
p = re.compile(r"\.{" + str(k) + ",}")
for i in s:
    ans += sum(map(lambda x: len(x) - k + 1, p.findall(i)))

print(ans)

# -*- coding: utf - 8 -*-
"""""""""""""""""""""""""""""""""""""""""""""
|    author: mr.math - Hakimov Rahimjon     |
|    e-mail: mr.math0777@gmail.com          |
|    created: 04.02.2018 13:29              |
"""""""""""""""""""""""""""""""""""""""""""""
# inp = open("input.txt", "r"); input = inp.readline; out = open("output.txt", "w"); print = out.write
TN = 1


# ===========================================


def solution():
    import re
    n, m, k = list(map(int, input().split()))
    s = [input() for _ in range(n)]
    if n > 1 and k > 1:
        t = list(["".join(x) for x in zip(*s)])
        s += t

    ans = 0
    p = re.compile(r"\.{" + str(k) + ",}")
    for i in s:
        ans += sum([len(x) - k + 1 for x in p.findall(i)])

    print(ans)


# ===========================================
while TN != 0:
    solution()
    TN -= 1
# ===========================================
# inp.close()
# out.close()


# -*- coding: utf - 8 -*-
"""""""""""""""""""""""""""""""""""""""""""""
|    author: mr.math - Hakimov Rahimjon     |
|    e-mail: mr.math0777@gmail.com          |
|    created: 04.02.2018 13:29              |
"""""""""""""""""""""""""""""""""""""""""""""
# inp = open("input.txt", "r"); input = inp.readline; out = open("output.txt", "w"); print = out.write
TN = 1


# ===========================================


def solution():
    import re
    n, m, k = list(map(int, input().split()))
    s = [input() for _ in range(n)]
    if n > 1 and k > 1:
        t = list(["".join(x) for x in zip(*s)])
        s += t

    ans = 0
    p = re.compile(r"\.{" + str(k) + ",}")
    for i in s:
        ans += sum([len(x) - k + 1 for x in p.findall(i)])

    print(ans)


# ===========================================
while TN != 0:
    solution()
    TN -= 1
# ===========================================
# inp.close()
# out.close()


"""This one should be very simple"""


def method(matrix, k):
    if k == 1:
        res = sum(line.count(".") for line in matrix)
    else:
        res = 0
        for is_transpose in (False, True):
            if is_transpose or len(matrix[0]) >= k:
                for line in matrix:
                    gen = iter(line)
                    consecutive = 0
                    for c in gen:
                        if c == ".":
                            consecutive += 1
                        else:
                            if consecutive >= k:
                                res += consecutive - k + 1
                            consecutive = 0
                            try:
                                while next(gen) == "*":
                                    pass
                                consecutive = 1
                            except StopIteration:
                                pass
                    if consecutive >= k:
                        # If ended in consecutive empty seats with enough space
                        res += consecutive - k + 1
            if not is_transpose:
                # Just a funny way of 
                if len(matrix) < k:
                    break  # Don't bother with transpose if consecutive seats are impossible
                matrix = list(zip(*matrix))
    return res


n, m, k = list(map(int, input().split()))
matrix = []
for _ in range(n):
    matrix.append(input())
print(method(matrix, k))


y,x,k=map(int,input().split())
m=[];ans=0
for i in range(y):
    m.append(list(input()))
    e=0
    for z in m[i]:
        if z=='.':
            e+=1
        else:
            ans+=max(0,e-k+1)
            e=0
    ans+=max(0,e-k+1)
if k-1:
    for j in range(x):
        e=0
        for i in range(y):
            if m[i][j]=='.':
                e+=1
            else:
                ans+=max(0,e-k+1)
                e=0
        ans+=max(0,e-k+1)
print(ans)

n, m, k = list(map(int, input().split()))
s = []
up = [[0] * m] * n
left =[[0] * m] * n
ans = 0
for i in range(n):
    s.append(input())
    for j in range(m):
        if s[i][j] == '.':
            up[i][j] = (0 if i == 0 else up[i - 1][j]) + 1
            left[i][j] = (0 if j == 0 else left[i][j - 1]) + 1
        else:
            up[i][j] = 0
            left[i][j] = 0
        ans += up[i][j] >= k
        ans += left[i][j] >= k
if k == 1:
    ans //= 2
print(ans)


m, n, k = list(map(int, input().split()))
Matrix = []
for i in range(m):
    s =  input()
    Matrix.append([])
    for j in range(n):
        if s[j] == '*':
            Matrix[i].append(0)
        else:
            Matrix[i].append(1)
count = 0
for i in range(m):
    res = 0
    for j in range(n):
        if Matrix[i][j]:
            res += 1
            if res >= k:
                count += 1
        else:
            res = 0

for i in range(n):
    res = 0
    for j in range(m):
        if Matrix[j][i]:
            res += 1
            if res >= k:
                count += 1
        else:
            res = 0
if k == 1:
    count //= 2

print(count)