n = int(input())
stones = input()

left = stones.find("#")

if left == -1:
    print(0)
else:
    right = stones.rfind("#")
    stonesToChange = stones[left : right]
    print(min(stones[left:right].count("."), stones[left:].count("#")))