num = int(input())
stone = list(input())

count = 0
new_stone = ""
for i in range(num - 1):
    if stone[i] == "#" and stone[i + 1] == ".":
        if i == 0:
            stone[i] = "."
        else:
            stone[i + 1] = "#"
        count += 1
# print(count, "".join(stone))
print(count)