input =   readlines.map(&:chomp).map{|n| n.split(' ')}
H,W,K =input[0].map(&:to_i)

index = 0

h = 0
while h <= H
    R = []
    remain = []
    w = 0

    i = 1
    diff = H-h
    while i<=diff
        remain.push(input[i+h])
        i += 1
    end
    while w <= W
        remain.each do |r|
            a = r[0].split('')
            R.push(a[W,a.length-1])
        end
        w += 1
    end
    R.each do |arr|
        if arr.count('#') == K
            index +=1
        end
    end
    h += 1
end

p index + 1