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

stones = []

for c in S:
    stones.append(c)

k = 0

for i,stone in enumerate(stones):
    if i < len(stones) - 1:
        if stone == "#":
            if stones[i+1] == ".":
                stones[i+1] = "#"
                k += 1
print(k)