N = int(input())
S = input()
c = S.count("#")
min = 200000
if S.count("#") == 0:
  min = 0
for i in range(N):
  if S[i] == "#":
    if min > S[i:].count("."):
    	min = S[i:].count(".")
  S = S.replace("#",".",1)

print(min)