from functools import reduce
input()
src = list(map(lambda x: 1 if x=="#" else 0, input()))
ans = sum(src)
for i in range(len(src)):
  ans = min(ans, sum(src[:i]) + len(src[i:]) - sum(src[i:]))
  if ans==0:
    break
print(ans)