# C - Stones

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

#print(list(S))
cnt = 0


# stones[i] == "#" のときに stones[i+1] == "." なら stones[i+1] = "#"にしてcnt ++する
def BlackToWhite(stones, len, i):
    global cnt
    if stones[0:i + 1]:
        if stones[i] == "#" and stones[i + 1] == ".":
            cnt += 1
            stones[i + 1] = "#"

        i += 1
        if i >= len - 1:
            print(cnt)
            exit()
        else:
            BlackToWhite(stones, len, i)
    else:
        print(cnt)
        exit()


BlackToWhite(list(S), N, 0)

