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

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

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

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

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

print(min(ANS1, ANS2))