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

count_list =[]
wc = 0

A=[0]*(N)
bc = 0

for i in list(range(N))[::-1]:
    if(S[i] == '#'):
        bc  += 1
    A[i] = bc

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)