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

count_list =[]
wc = 0

A=[0]*N

for i in range(N):
     A[i] = A[i+1] + (S[i] == '#' ? 1 : 0))
A[N] = 0

for n in range(N-1):
    if(S[n] == '.'):
        num = n
        count_list.append(A[n+1] + wc)
        wc += 1

if(S[N-1] == '.'):
    count_list.append(wc+1)

count = min(count_list)
print(count)