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

if N==1:
    print("0")
else:
    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)
