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

listS = list(S)
count1 = 0
count2 = 0
count3 = 0
count4 = 0

a = 0
b = 0

for i in range(N):
    if listS[i] == '.':
        continue
    else:
        a = i
        break

for i in range(N):
    if listS[N-1-i] == '#':
        continue
    else:
        b = N-i
        break

count1 = listS[:N-1].count('#')
count2 = listS[1:].count('.')
count3 = listS[a:b].count('.')
count4 = listS[a:b].count('#')

print(min(count1, count2, count3, count4))