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

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

rind=N
for i in reversed(range(N)):
  if S[i]==".":
    rind=i
    break

print(min(S[ind+1:].count("."),S[:rind].count("#")))