N = int(input())
S = input()
ans = N
pos = 0
S = [S[n] == '#' for n in range(N)]
cntB = 0
for index in range(N):
    if S[index]:
        cntB += 1
    ans = min(cntB + (N -(index+1) -sum(S[index+1:N])), ans)

    # print(cntB,(N -(index+1) -sum(S[index+1:N])))
print(ans)
