import sys

# 1 Parse and collect.
iter_in = iter(sys.stdin)
scores = []
n, m, k = tuple(map(int, next(iter_in).split()))
arr_score = [-1] * m
for line in iter_in:
    for j in range(m):
        if line[j] == 'o':
            arr_score[j] += 1
        else:
            if arr_score[j] > 0:
                scores.append(arr_score[j])
            arr_score[j] = -1
scores.extend(x for x in arr_score if x > 0)

# 2 Calculate max score.
scores.sort(reverse=True)
acc_score = 0
acc_cell = 0
for score in scores:
    acc_cell += score + 1
    if acc_cell > k:
        acc_score += max(0, score - (acc_cell - k))
        break
    acc_score += score

# 3 Output
print(acc_score)