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

ANS1 = 1000000000
if S[0] == '#':
    ANS1 = S.count('.') 

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

ANS2 = S[cnt:].count('.') 

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

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

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