_ = input()
S = input().strip()

min_s = len(S)
for d in range(len(S)+1):
  left = len([1 for s in S[:d] if s == '#'])
  right = len([1 for s in S[d:] if s == '.'])
  if min_s > left+right:
    min_s = left+right

print(min_s)