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

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

l_dot = 0
for i in range(N-1, -1, -1):
  if S[i] == ".":
    l_dot = i
    break

#print(S[f_sharp:l_dot+1])
sharp = S[f_sharp:l_dot+1].count("#")
dot = S[f_sharp:l_dot+1].count(".")
print(min(sharp, dot))