n = int(input())
slis = list(input())

siro = 0
k = 0
for i in range(n):
  if k == 1 and slis[i] == ".":
    siro += 1
  if k == 0 and slis[i] =="#":
    k += 1

kuro = 0
s = 0
for j in range(n-1,-1,-1):
  if s == 1 and slis[j] == "#":
    kuro += 1
  if s == 0 and slis[j] == ".":
    s += 1

#print(siro,kuro)
print(min(kuro,siro))