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