N=input()
S=list(map(str,input()))
#block
index_num = [n for n,v in enumerate(S) if v =='#']
b_count = 0
for i in index_num:
    if i!=len(S)-1 and S[i+1]=='.':
        b_count += 1
#white
index_num = [n for n,v in enumerate(S) if v =='.']
w_count = 0
for i in index_num:
    if i!=0 and S[i-1]=='#':
        w_count += 1
print(min([b_count, w_count]))