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

L=0
R=N-1
while L<=N-1 and S[L]=='.':
    L+=1
while R>=0 and S[R]=='#':
    R-=1
B=0
for i in range(L,R+1):
    if S[i]=='#':
        B+=1
D=max(R-L+1,0)
W=D-B
print(min(B,W))
