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

counterMin = 1000000
for b in range(N):
    counter=0
    for i in range(0, b):
        if S[i]=='#':
            counter+=1
    for i in range(b, N):
        if S[i]=='.':
            counter+=1
    if counter<counterMin:
        counterMin=counter
print(counterMin)