import strutils, sequtils

let
  n = stdin.readline.parseInt
  s = stdin.readline & '#'

var
  ds: seq[int] = @[]
  ss: seq[int] = @[]
  cnt = 0
  now = '#'
  stt = true

for i, c in s:
  if stt and c == '.':
    continue
  stt = false
  if now == c:
    inc(cnt)
  else:
    if now == '#':
      ss.add(cnt)
      now = '.'
    else:
      ds.add(cnt)
      now = '#'
    cnt = 1

if ss.len == 0:
  echo 0
else:
  var rt = high(int)
  for i in 0..<ss.len:
    var sm = 0
    for j in  0..<ss.len:
      if i > j:
        sm = sm + ss[j]
      else:
        sm = sm + ds[j]
    if sm < rt:
      rt = sm

  echo rt


