n=int(input())
s=list(input())
count=[0]*(n+1)
for i in range(n+1):
    for j in range(n):
        if j<i:
            if s[j]=='#':
                count[i]+=1
        else:
            if s[j]=='.':
                count[i]+=1
print(min(count))