from itertools import accumulate

n = int(input())
s = input()

black = [0] * (n+1)
white = [0] * (n+1)
ans = [0] * (n+1)
for i in range(n+1):
  black[i] = s[:i].count("#")
  white[i] = s[i:].count(".")
  ans[i] = black[i] + white[i]
print(min(ans))