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

cou_b = 0
cou_w = 0

for i in range(N):
    if S[i]=='#':
        cou_b = S[i:].count('.')
        break
for i in range(N-1,-1,-1):
    if S[i]=='.':
        cou_w = S[:i].count('#')
        break
print(min(cou_b,cou_w))