using System;
using System.Collections.Generic;
public class Program {
public static void Main()
{
string line = System.Console.ReadLine();
string[] po = line.Split();
int n = int.Parse(po[0]), m = int.Parse(po[1]), k = int.Parse(po[2]), current = 0, score = 0;
List<int> mapK = new List<int>();
Char[,] map = new Char[n, m];
for (int i = 0; i < n; i++)
{
line = System.Console.ReadLine();
for (int j = 0; j < m; j++)
{
map[i, j] = line[j];
}
}
int w = 0;
for (int i = 0; i < m; i++)
{
w = 0;
for (int j = 0; j < n; j++)
{
if (map[j, i] == 'o')
{
w++;
}
else
{
mapK.Add(w);
w = 0;
}
}
mapK.Add(w);
}
mapK.Sort();
mapK.Reverse();
for (int i = 0; i < mapK.Count; i++)
{
if (k < 2) break;
current = System.Math.Min(mapK[i], k);
score += current - 1;
k -= current;
}
System.Console.WriteLine(score);
}
}