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

flug = False
cnt1 = 0
for i,n in enumerate(S):
    if S[i]=='#':
        flug=True
    else:
        if flug and S[i]=='.':
            cnt1+=1
        else:
            flug=False

flug = False
cnt2 = 0
S_rev = S[::-1]
for i,n in enumerate(S_rev):
    if S_rev[i]=='.':
        flug=True
    else:
        if flug and S_rev[i]=='#':
            cnt2+=1
        else:
            flug=False
    
print(min(cnt1,cnt2))