n = int(input())
s = list(input())
b_c,h_c = s.count('#'),s.count('.')
ans = n
b_r,h_r = 0,0
for i in range(n-1):
    if s[i]=='#':b_r+=1
    else:h_r+=1
    if s[i]!=s[i+1]:
        ans = min(ans,b_r+h_c-h_r)
if s[-1]=='#':b_r+=1
else:h_r+=1
ans = min(ans,b_r+h_c-h_r)
print(ans)