N=int(input())
S=input()
# . が white
# # が black
right="#"

f_sharp = 0
for i in range(0, N):
  if S[i] == "#":
    f_sharp = i
    break

ans = 0
sharp = S[f_sharp:].count("#")
dot = S[f_sharp:].count(".")
print(min(sharp, dot))