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