n = gets.to_i
s = gets.chomp.split('')
black_num_list = s.inject([0]){|list,str| list << list[-1] + (str == '#' ? 1 : 0)}
min = black_num_list.length - black_num_list[-1]
(1...black_num_list.length).each do |i|
 tmp_min = black_num_list[i] + n - i - black_num_list[-1] + black_num_list[i]
 min = tmp_min if tmp_min < min
end
puts min