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

cntA = 0
for i in S:
    if i == '.':
        cntA += 1
    else:
        break

cntB = 0
newS = ''.join(list(reversed(S)))
for i in newS:
    if i == '#':
        cntB += 1
    else:
        break

ANS1 = S[cntA:N-cntB].count('.') 
ANS2 = S[cntA:N-cntB].count('#')
#print(S[cntA:N-cntB])
print(min(ANS1, ANS2))