N = int(input())
S = input()
cnt = N
for i in range(N+1):
    if i == 0:
        cnt = min(S.count('#'), cnt)
    elif i == N+1:
        cnt = min(S.count('.'), cnt)
    else:
        cnt = min(S[:i].count('#') + S[i:].count('.'), cnt)
print(cnt)