N = gets.to_i
S = gets.chomp
ans = 0
N.downto(0) do |i|
  if S[i] == "#" then S[i] = "" else break end
end
0.upto(N) do |i|
  if S[i] == "." then S[i] = "" else break end
end

if !(S.match("#"))||!(S.match(".")) then puts 0; exit end
for i in 0...N-1
  if S[i..i+1] == "#." then ans += 1; S[i+1] = "#" end
end