n = gets.to_i
s = gets.chomp
arr = Array.new(n,0)
n.times do |i|
  if i != 0
    arr[i] = arr[i-1]
  end
  arr[i] += 1 if s[i] == '.'
end
min = n
(n-1).times do |i|
  count = (i - arr[i])
  count += (n-i - (arr[n-1] - arr[i]))
  min = count if min > count
end
min = [min,arr[n-1],n-arr[n-1]].min
puts min