n = gets.to_i
s = gets.chomp

#white[i]:左端から数えてi個の石のうち，白い石が何個あるか
#ただし，white[0] = 0
white = Array.new(n+1, 0)
#black[i]: 黒について同様の定義
black = Array.new(n+1, 0)

for i in 0..n-1 do
  if s[i] == "."
    white[i+1] = white[i] + 1
    black[i+1] = black[i]
  else
    white[i+1] = white[i]
    black[i+1] = black[i] + 1
  end
end

min = 10**9

for i in 0..n do
  tmp = (black[i] - black[0]) + (white[n] - white[i])
  min = tmp if tmp < min
end

puts min
