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

sm_w = [0]*(N+1)
sm_b = [0]*(N+1)

for i in range(N):
    s = S[i]
    sm_w[i+1] += sm_w[i]
    sm_b[i+1] += sm_b[i]
    if s == '.':
        sm_w[i+1] += 1
    else:
        sm_b[i+1] += 1

ans = 2**12
for i in range(N+1):
    left_b = 0
    if i!=0:
        left_b = sm_b[i]
    right_w = 0
    if i!=N:
        right_w = sm_w[N] - sm_w[i]
    ret = left_b + right_w
    ans = min(ans, ret)
print(ans)
    
