# coding: utf-8
_ = input()
s = list(input())
cnt = 0

for i in range(1, len(s)-1):
    if s[i-1] == '.' and s[i] =='#' and s[i+1] == '.':
        s[i] = '.'
        cnt +=  1
    elif s[i] == '#' and s[i+1] == '#':
        if s[i+2:].count('#') > s[i+2:].count('.'):
            break
        else:
            s[i], s[i+1] = '#', '#'


try:
    sl = s[s.index('#'):]
    if sl.count('#') < sl.count('.'):
        print(sl.count('#') + cnt)
    else:
        print(sl.count('.') + cnt)
except:
    print(cnt)