stones = [raw_input() for i in range(2)][1]
for ind, i in enumerate(stones, start=0):
    if i == "#":
        b, w = 0, 0
        for i in stones[ind:]:
            if i == ".":
                w += 1
            else:
                b += 1
        print(min(b, w))
        break
else:
    print(0)
