N = gets.to_i
s = gets.chomp

l = 0
while l < N && s[l] == "." 
  l += 1
end
ans = 0
while l < N
  if s[l] == "."
    ans += 1 
    while l < N && s[l] == "."
      l += 1
    end
  else
    l += 1
  end
end
r = N-1
while r >= 0 && s[r] == "#" 
  r -= 1
end
ans2 = 0
while r >= 0
  if s[r] == "#"
    ans2 += 1 
    while r >= 0 && s[r] == "#"
      r -= 1
    end
  else
    r -= 1
  end
end
p [ans,ans2].min