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