N = int(input())
S = list(input())

kurodeta = False
cnt = 0
for stone in S:
    if not kurodeta and stone == ".":
        continue

    if stone == "#":
        kurodeta = True

    if stone == ".":
        cnt += 1


shirodeta = False
kurocount = 0
if S[-1] == "#":
    for stone in reversed(S):
        if not shirodeta and stone == "#":
            continue

        if stone == ".":
            shirodeta = True

        if stone == "#":
            kurocount += 1
else:
    kurocount = S.count("#")

print(min(cnt, kurocount))
