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

countW = 0
countB = 0
flagW = False
flagB = False

for i in range(N):
    if not flagW:
        if S[i] == "#":
            flagW = True
    else:
        if S[i] == ".":
            countW += 1
    
    if not flagB:
        if S[-(i + 1)] == ".":
            flagB = True
    
    else:
        if S[-(i + 1)] == "#":
            countB += 1
            
if countB > countW:
    print(countW)
else:
    print(countB)