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

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