N=input()
S=list(map(str,input()))

index_num = [n for n,v in enumerate(S) if v =='#']
#block >= harf

if len(index_num) >= len(S):
    print(len(index_num))
else:
    index_num_w = [n for n,v in enumerate(S) if v =='.']
    w_count = 0
    for i in index_num_w:
        if i!=0 and S[i-1]=='#':
            w_count += 1
    print(w_count)  