from itertools import accumulate





N = int(eval(input()))

S = eval(input())



black = [0 for _ in range(N)]

white = [0 for _ in range(N)]



for i, s in enumerate(S):

    if s == '#':

        black[i] = 1

    else:

        white[i] = 1



# 累積和

black = [0] + black

black = list(accumulate(black))

white = [0] + white[::-1]

white = list(accumulate(white))[::-1]



ans = []

for i in range(N+1):

    ans.append(black[i] + white[i])



print((min(ans)))

from itertools import accumulate





N = int(eval(input()))

S = eval(input())



black = [0]*N

white = [0]*N



for i, s in enumerate(S):

    if s == '#':

        black[i] = 1

    else:

        white[i] = 1



# 累積和

black = [0] + black

black = list(accumulate(black))

white = [0] + white[::-1]

white = list(accumulate(white))[::-1]



ans = []

for i in range(N+1):

    ans.append(black[i] + white[i])



print((min(ans)))

from itertools import accumulate

N = int(eval(input()))
S = eval(input())
black = [0 for _ in range(N)]
white = [0 for _ in range(N)]
for i, s in enumerate(S):
    if s == "#":
        black[i] = 1
    else:
        white[i] = 1
# 累積和
black = [0] + black
black = list(accumulate(black))
white = [0] + white[::-1]
white = list(accumulate(white))[::-1]
ans = []
for i in range(N + 1):
    ans.append(black[i] + white[i])
print((min(ans)))

from itertools import accumulate

N = int(eval(input()))
S = eval(input())
black = [0] * N
white = [0] * N
for i, s in enumerate(S):
    if s == "#":
        black[i] = 1
    else:
        white[i] = 1
# 累積和
black = [0] + black
black = list(accumulate(black))
white = [0] + white[::-1]
white = list(accumulate(white))[::-1]
ans = []
for i in range(N + 1):
    ans.append(black[i] + white[i])
print((min(ans)))

-black = [0 for _ in range(N)] -white = [0 for _ in range(N)] +black = [0] * N +white = [0] * N