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

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

ANS1 = S[cnt:].count('.') 
ANS3 = S[cnt:].count('#')

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

ANS2 = newS[cnt:].count('#')
ANS4 = newS[cnt:].count('.')

print(min([ANS1, ANS2, ANS3, ANS4]))