N=int(input())
s=input()
s=[s[i] for i in range(len(s))]
tmp=N
for i in range(N):
    count=0
    for j in range(N):
        if j<=i and s[j]=="#":
                count=count+1
       	else:
            if s[j]==".":
                count = count+1
    if tmp>count:
        tmp=count
print(tmp)
