from collections import Counter
N = int(input())
S = input()
BN = [0 for i in range(N)]
if S[0] == '.':
    BN[0] = 0
else:
    BN[0] = 1
for i in range(1, N):
    if S[i] == '.':
        BN[i] = BN[i-1]
        continue
    BN[i] = BN[i-1] + 1
ans = min(N-BN[-1], BN[-1])
for i in range(1,N):
    white = BN[i-1]
    black = N-(i)-(BN[i]-BN[i-1])
    ans = min(ans, white+black)
print(ans)
