import times, strutils, sequtils, math, algorithm, tables, sets, lists, intsets
import critbits, future, strformat, deques
template `max=`(x,y) = x = max(x,y)
template `min=`(x,y) = x = min(x,y)
let read* = iterator: string {.closure.} =
    while true: (for s in stdin.readLine.split: yield s)
proc scan(): int = read().parseInt
proc toInt(c:char): int =
    return int(c) - int('0')



proc solve():int=
  var
    n = scan()
    s = read()
    lidx = 0
    ridx = 0
  for i in 0..<n:
    if s[i] == '#':
      lidx = i
      break
  for i in 1..n:
    if s[n-i] == '.':
      ridx = n-i
      break
  #echo s[lidx..<n]
  #echo s[0..ridx]
  result = min(s[lidx..<n].count("."),s[0..ridx].count("#"))
  
  
    

    
  
echo solve()