from itertools import product
n=int(input())
s=input()

cnt_left=[]
cnt_right=[]
ans=1145141919
for i in range(1,n+1):
    cnt_right.append(s[:i].count("#"))
    cnt_left.append(s[i:].count("."))
for i in range(n):
    ans=min(ans,(cnt_right[i]+cnt_left[i]))
print(ans)
