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

W = S.count('.')
B = 0
ans = N
if W == 0:
    print (0)
else:
    for i in range(0,N):
#        print (i)
        if S[i] == '#':
            B += 1
        else:
            W -= 1
        ans = min(ans, B+W)
    print (ans)