N=int(input())
S=input()
compress = []
compress.append([S[0],1])
for idx,s in enumerate(S):
    if idx==0:
        pass
    else:
        if compress[-1][0] == s:
            compress[-1][1] +=1
        else:
            compress.append([s,1])
cnt = []
for i in range(len(compress)):
    cnt_tmp = 0
    for idx,c in enumerate(compress):
        if i <= idx and c[0]==".":
            cnt_tmp += c[1]
        elif i > idx and c[0]=="#":
            cnt_tmp += c[1]
    cnt.append(cnt_tmp)
cnt_tmp = 0
for c in compress:
    if c=="#": cnt_tmp += 1
cnt.append(cnt_tmp)
    
    
print(min(cnt))