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 len(stones) > i + 1:
        if stone == "#":
            if stones[i+1] == ".":
                if len(stones) > i + 2 :
                    if stones[i+2] == ".":
                        stones[i] = "."
                    else:
                        stones[i] = "#"
                    k += 1
                else:
                    stones[i+1] = "#"
                    k += 1
print(k)