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