N  = int(input())
S = input()
black = S.count("#")
white = N - black
if black == 0 or white == 0:
    print(0)
else:
    if S[-1] == "#":
        black -= 1
    if S[0] == ".":
        white -=1
    print(min(black, white))
