import sys
a = [ i.replace('\n','') for i in list(sys.stdin)]
n,m,k = tuple(map(int,a[0].split(' ')))
a.pop(0)
max_o = []
score = 0
for j in range(m):
    count = 0
    for i in range(n):
        if a[i][j] == 'o':
            count += 1
        else:
            max_o.append(count)
            count = 0
            continue
    max_o.append(count)
max_o = sorted(max_o,reverse=True)
for j in range(len(max_o)):
    max_geze = max_o[j]
    if k==0 or max_geze == 0:
        break
    if k > 0:
        if k > max_geze:
            score += max_geze-1
            k -= max_geze
        else:
            score += k-1
            k = 0
print(score)