length = gets.to_i
input = gets.to_s
times = 0

for index in 0..length-2 do
    if  input[index] == "#" && input[index+1] == "." 
      input[index+1] = "#" 
      times = times + 1
    end
end

puts times