N = int(input())
S = list(input())

x = 0
while S[x] == ".":
  x += 1
  if x == N:
    break

yindex = N - 1
ycount = 0
while S[yindex] == "#":
  yindex -= 1
  ycount += 1
  if yindex == -1:
    break

w = 0
b = 0
for j in range(N):
  if S[j] == ".":
    w += 1
  else:
    b += 1
    
if w - x <= b - ycount:
  print(w - x)
else:
  print(b - ycount)