_ = input()

letter = input()

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

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