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

left = stones.find("#")

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


    print(min(stonesToChange.count("."), stonesToChange.count("#")))