import numpy

N=int(eval(input()))

S=list(map(str,eval(input())))

S_modify = [0 if i=="." else 1 for i in S]

count_list = []



sum_list=numpy.cumsum(S_modify)

sum_list_reverse=numpy.cumsum(S_modify[::-1])

for i in range(N):

    count = sum_list[i]+((N-i-1)-sum_list_reverse[N-i-1])

    count_list.append(count)

print((min(count_list)))
N = int(eval(input()))

S = eval(input())

 

left_black=0

right_white=S.count(".")

ans=left_black+right_white

 

for i in S:

    if i==".":

        right_white-=1

        ans=min(ans,left_black+right_white)

    else:

        left_black+=1

        ans=min(ans,left_black+right_white)

print(ans)
import numpy

N = int(eval(input()))
S = list(map(str, eval(input())))
S_modify = [0 if i == "." else 1 for i in S]
count_list = []
sum_list = numpy.cumsum(S_modify)
sum_list_reverse = numpy.cumsum(S_modify[::-1])
for i in range(N):
    count = sum_list[i] + ((N - i - 1) - sum_list_reverse[N - i - 1])
    count_list.append(count)
print((min(count_list)))

N = int(eval(input()))
S = eval(input())
left_black = 0
right_white = S.count(".")
ans = left_black + right_white
for i in S:
    if i == ".":
        right_white -= 1
        ans = min(ans, left_black + right_white)
    else:
        left_black += 1
        ans = min(ans, left_black + right_white)
print(ans)

-import numpy - -S = list(map(str, eval(input()))) -S_modify = [0 if i == "." else 1 for i in S] -count_list = [] -sum_list = numpy.cumsum(S_modify) -sum_list_reverse = numpy.cumsum(S_modify[::-1]) -for i in range(N): -    count = sum_list[i] + ((N - i - 1) - sum_list_reverse[N - i - 1]) -    count_list.append(count) -print((min(count_list))) +S = eval(input()) +left_black = 0 +right_white = S.count(".") +ans = left_black + right_white +for i in S: +    if i == ".": +        right_white -= 1 +        ans = min(ans, left_black + right_white) +    else: +        left_black += 1 +        ans = min(ans, left_black + right_white) +print(ans)