N = int(input())
S = input()

stones = []

for c in S:
    stones.append(c)

stones2 = stones.copy()

k = 0

for i,stone in enumerate(stones):
    if i < len(stones) - 1:
        if stone == "#":
            if stones[i+1] == ".":
                stones[i+1] = "#"
                k += 1
l = 0
for i,stone in enumerate(stones2[::-1]):
    a = len(stones) - i -1
    if a != 0:
        if stone == ".":
            if stones[a-1] == "#":
                stones[a-1] = "."
                l += 1


print(k if k < l else l)
