n = gets.chomp.to_i
s = gets.chomp

#puts "now s = #{s}"

new_s = ""
count_1=0
count_2=0
flag = 0

s.length.times do |i|
  if flag==0 && s[i]=="#" then 
    flag = 1
  elsif flag==1 && s[i]=="." then 
    #s[i] = "#"
    count_1+=1 
  end
end
flag = 0

if_count=0
s.length.times do|i|
  if flag==0 &&s[i]=="#" then
    flag=1
    if_count=1
  elsif flag==1&& s[i]=="#" then
    if_count+=1
  elsif flag==1&&s[i]=="." then
    flag=0
    count_2+= if_count
    if_coun=0 
  end 
end

puts [count_1,count_2].min