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

w = 0
for i in range(n):
    if s[i] == '.':
        w += 1
    else:
        break

b = 0
for i in range(n):
    if s[-i - 1] == '#':
        b += 1
    else:
        break

print(max(s[w:-1].count('.'), s[-1:-b:-1].count('#')))