N = int(input())
S = str(input())

white = 0
black = 0
ans = None

for i in range(N):
  white = S[0:i].count("#")
  black = S[i+1:N+1].count(".")
  if ans == None:
    ans = white+black
  else:
    ans = min(ans,white+black)

print(ans)
