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

if s == '.' * n or s == '#' * n:
    print(0)
    exit()

idx = -1
for i, c in enumerate(s):
    if c == '#':
        idx = i
        break

print(min(s[idx:].count('.'), ( s[idx:].count('#') - 1 if s[n - 1] == '#' else s[idx:].count('#'))))
