n = int(input())
s = input()
ssp = s.split('.')
num = min(s.count('.'),s.count('#') - len(ssp[-1]))
if s.count('#') == 0 or s.count('.') == 0:
    print(0)
    exit()
for i in range(n):
    if s[i - 1] == s[i]:
        continue
    num = min(num,s[:i].count('#') + s[i:].count('.'))
print(num)