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

CW = 0

for s in S:
    if s == '.' : CW += 1
    
CB = 0
ans = 2**30
for s in S:
    if s == '.' : CW -= 1
    if s == '#' : CB += 1
    ans = min(ans,CB+CW)
    
print(ans)
    
