n = int(input())
S = [s for s in input()]
ans = 0
try:
    #print(S.index('#'))
    for i in range(S.index('#')+1,n):
        if S[i] is '.':
            ans += 1
    print(min(ans,S.count('#')))
except:
    print(0)
