n=int(input())
s=input()
w = s.count('.')
if s[0]=='#':
    print(min(w,n-w))
else:
    cnt = 0
    w = s.count('.')
    for i in range(0,n):
        if s[i]=='.':
            cnt+=1
        else:
            break
    ans = w-cnt
    print(min(w,ans,n-w))