n = int(input())
s = input()

array = [c for c in s]
tmp1 = 0
for i in range(len(array) - 1, 0, -1):
    if array[i] == "." and array[i - 1] == "#":
        array[i - 1] = "."
        tmp1 += 1


array = [c for c in s]
tmp2 = 0
for i in range(len(array) - 1):
    if array[i] == "#" and array[i + 1] == ".":
        array[i + 1] = "#"
        tmp2 += 1

print(min(tmp1, tmp2))
