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

ans = N+1
prev = ""


black = 0
white = S.count(".")

first_white = white
first_black = N - first_white

for i in range(N):
    current = S[i]

    if prev is "#" and current is ".":

        ans = min(ans, black+white)

    if current is ".":
        white -= 1
    elif current is "#":
        black += 1

    prev = current

if ans == N + 1:
    ans = 0

print(min(ans, first_black, first_white))
