n = int(input())
s = input()

W = [0] * n
B = [0] * n

for i in range(n):
    if i == 0:
        if s[-1] == '.':
            W[-1] = 1
    elif s[-i-1] == '.':
        W[-i-1] = W[-i] + 1
    else:
        W[-i-1] = W[-i]

#print(W)

for i in range(n):
    if i == 0:
        B[i] = 0
    elif s[i-1] == '#':
        B[i] = B[i-1] + 1
    else:
        B[i] = B[i-1]

#print(B)

if W[0] == n:
    print(0)
else:
    ans = n
    for i in range(n):
        c = W[i] + B[i]

        ans = min(ans, c)

    print(ans)
