N = gets.to_i
s = gets.chomp
l = 0
while l < N && s[l] == "." 
  l += 1
end
ans = 0
l.upto(N-1) do |i|
  ans += 1 if s[i] == "."
end
r = N-1
while r >=0 && s[r] == "#" 
  r -= 1
end
ans2 = 0
r.downto(0) do |i|
  ans2 += 1 if s[i] == "#"
end

p [ans,ans2].min