_ = input()

letter = input()

bk_back = 0
wt_front = 0
for i in range(len(letter)-1):
    if letter[i] == '#' and letter[i+1] == '.':
        for c in letter[:i+1]:
            if c == '#':
                bk_back += 1
            
        for c in letter[i+1:]:
            if c == '.':
                wt_front += 1
                
        break

bk_front = 0
wt_back = 0
for i in range(1, len(letter)):
    if letter[-i] == '.' and letter[-i-1] == '#':
        for c in letter[-i:]:
            if c == '.':
                wt_back += 1
        
        for c in letter[:-i]:
            if c == '#':
                bk_front += 1
                
        break

print(min(bk_back + wt_back, wt_front, bk_front))