n = int(input())
s = input()
d = n - s[::-1].find('.') - 1
c = s[:d].count('#')
d2 = s.find('#')
c2 = s[d2:].count('.')
ans = 10**9
for i in range(n + 1):
    ans = min(ans, s[:i].count('#') + s[i:].count('.'))
print(ans)