N = int(input())
S = input()
t = S.count(".")
if t == N or t == 0:
    print(0)
    exit(0)

W = [0 for k in range(N+1)]
B = [0 for k in range(N+1)]

for k in range(N):
    if S[k] == "#":
        B[k] = B[k-1] + 1
    else:
        B[k] = B[k-1]

W[0] = t
for k in range(1,N):
    if S[k] == ".":
        W[k] = W[k-1] - 1
    else:
        W[k] = W[k-1]
ans = N
for k in range(N):
    ans = min(ans,W[k]+B[k])
print(ans)