N=int(input())
S=input()
cnt1 = 0
cnt2 = 0
for idx,s in enumerate(S):
    if s == "#" and idx < N:
        cnt1+=1
    if s==".":
        cnt2+=1
if cnt1 < cnt2:
    print(cnt1)
else:
    print(cnt2)
