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

count = 0
for i in range(N):
    if S[i] == '#':
        for j in range(i+1,N):
            if S[j] == '.':
                count +=1
        break

count2 = 0
S_inv = S[::-1]
for i in range(N):
    if S_inv[i] == '.':
        for j in range(i+1,N):
            if S_inv[j] == '#':
                count2 +=1
        break
        
print(min(count,count2))