# https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_c

n = gets.to_i
stones = gets.chomp.chars
res = []

total_black = stones.count('#')
total_white = stones.count('.')
left_black = 0
right_white = total_white

0.upto(stones.size) do |idx|
  res << right_white + left_black
  c = stones[idx]
  left_black += 1 if c == '#'
  right_white -= 1 if c == '.'
end
# p res
puts res.min
