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

count = 0
# 多分、これだと最小値ではない
# for i in range(num - 1):
#     if stone[i] == "#" and stone[i + 1] == ".":
#         if i == 0:
#             stone[i] = "."
#         else:
#             stone[i + 1] = "#"
#         count += 1

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