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

cnt = N
cnt_left=0
cnt_right=S.count(".")
for i in range(N):
    if S[i] == "#":
        cnt_left += 1
    else:
        cnt_right -= 1

    if cnt_left + cnt_right < cnt:
        cnt = cnt_left + cnt_right
print(cnt)