n = int(input())
s = list(input())

count = 0
end = 0
flag = 0

for i in range(len(s)-1):
    if s[i] == '#' and s[i+1] == '.':
        if i == 0 or i == len(s) - 2:
            count += 1
            flag = 1
        elif flag==0:
            if s[:i].count('#') < s[i:].count('.'):
                count += len(s[:i])
            flag = 1
        else:
            if s[i-1] == '.':
                s[i] = '.'
                count += 1
            else:
                s[i+1] = '#'
                count += 1
print(count)