N = int(input())
S = input()
k = -1
for n,i in enumerate(S):
    if i=="#":
        k = n
        break
if k ==-1:
    print(0)
else:
    t =  sum([1 if i=="." else 0 for i in S[k:]])
    print(min(t,len(S[k:])-t))