stones = [raw_input() for i in range(2)][1]
if "." not in stones or "#" not in stones:
    print(0)

else:
    for start, i in enumerate(stones):
        if i == "#":
            break
    for end, i in enumerate(reversed(stones)):
        if i == ".":
            break

    b, w = 0, 0
    for i in stones[start:len(stones) - end]:
        if i == ".":
            w += 1
        else:
            b += 1
    print(min(b, w))
