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

for i in range(N):
    if S[i]=='#':
        break
B = S[i:].count('#')
W = S[i:].count('.') - len(S[i:].split('#')[1])
if S[-1]=="#":
    B -= 1
ans = min(B,W+1)
print(ans)
