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

cnt=N
for i in range(N+1):
    left = S[0:i+1]
    right = S[i+1:N]
    if (left.count("#") + right.count(".")) <= cnt:
        cnt = left.count("#") + right.count(".")
print(cnt)