N = int(input())
S = [i for i in input()]
for i in range(N):
    if(S[i]=='#'):
        break
for j in range(N-1,-1,-1):
    if(S[j]=='.'):
        break
t = N -(j+1)
s = S[i:]

a = s.count('#')
b = s.count('.')
print(min(a-t,b))