n = gets.to_i
s = gets.chomp.chars.map { |c| c == '#' } # black if true
tmp = s.count { |x| !x } # to all black
res = tmp
n.times do |i| # 0..i white, rest black
  if s[i]
    tmp+=1
  else
    tmp-=1
  end
  res=tmp if tmp<res
end
p res
