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