n = int(input())
s = input()
cnt = 0
cnt2 = 0
tmp = 0
tmp2 = 0
ans = 10**9
for i in s:
    if i=="#":
        cnt += 1
    else:
        cnt2 += 1
for i in s:
    if i=="#":
        tmp += 1
    else:
        tmp2 += 1
    ans = min(ans,tmp+cnt2-tmp2)
print(ans)